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,8 +130,7 @@ struct vector *dal_vector_create(
void dal_vector_destruct(
struct vector *vector)
{
if (vector->container != NULL)
kfree(vector->container);
kfree(vector->container);
vector->count = 0;
vector->capacity = 0;
}
......
......@@ -119,11 +119,8 @@ 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);
kfree(bp->base.bios_local_image);
kfree(bp->base.integrated_info);
}
static void bios_parser_destroy(struct dc_bios **dcb)
......
......@@ -85,11 +85,8 @@ 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);
kfree(bp->base.bios_local_image);
kfree(bp->base.integrated_info);
}
static void firmware_parser_destroy(struct dc_bios **dcb)
......
......@@ -159,8 +159,7 @@ 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);
kfree(dc->hwseq);
}
}
......
......@@ -619,14 +619,9 @@ 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->dp_ss_params);
kfree(dce110_clk_src->hdmi_ss_params);
kfree(dce110_clk_src->dvi_ss_params);
kfree(dce110_clk_src);
*clk_src = NULL;
......
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