mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 08:17:46 +00:00
amdgpu/dc: kfree already checks for NULL.
Don't bother checking for it. Found with the cocci ifnullfree.cocci script. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
5667ff5c11
commit
d029810caa
5 changed files with 9 additions and 22 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue