Commit d029810c authored by Dave Airlie's avatar Dave Airlie Committed by Alex Deucher

amdgpu/dc: kfree already checks for NULL.

Don't bother checking for it.

Found with the cocci ifnullfree.cocci script.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5667ff5c
......@@ -130,7 +130,6 @@ struct vector *dal_vector_create(
void dal_vector_destruct(
struct vector *vector)
{
if (vector->container != NULL)
kfree(vector->container);
vector->count = 0;
vector->capacity = 0;
......
......@@ -119,10 +119,7 @@ struct dc_bios *bios_parser_create(
static void destruct(struct bios_parser *bp)
{
if (bp->base.bios_local_image)
kfree(bp->base.bios_local_image);
if (bp->base.integrated_info)
kfree(bp->base.integrated_info);
}
......
......@@ -85,10 +85,7 @@ static struct atom_encoder_caps_record *get_encoder_cap_record(
static void destruct(struct bios_parser *bp)
{
if (bp->base.bios_local_image)
kfree(bp->base.bios_local_image);
if (bp->base.integrated_info)
kfree(bp->base.integrated_info);
}
......
......@@ -159,7 +159,6 @@ void dc_destroy_resource_pool(struct dc *dc)
if (dc->res_pool)
dc->res_pool->funcs->destroy(&dc->res_pool);
if (dc->hwseq)
kfree(dc->hwseq);
}
}
......
......@@ -619,13 +619,8 @@ void dce110_clock_source_destroy(struct clock_source **clk_src)
dce110_clk_src = TO_DCE110_CLK_SRC(*clk_src);
if (dce110_clk_src->dp_ss_params)
kfree(dce110_clk_src->dp_ss_params);
if (dce110_clk_src->hdmi_ss_params)
kfree(dce110_clk_src->hdmi_ss_params);
if (dce110_clk_src->dvi_ss_params)
kfree(dce110_clk_src->dvi_ss_params);
kfree(dce110_clk_src);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment