drm/amd/display: No need for Null pointer check before kfree
kfree() & vfree() internally performs NULL check on the pointer handed to it and take no action if it indeed is NULL. Hence there is no need for a pre-check of the memory pointer before handing it to kfree()/vfree(). Issue reported by ifnullfree.cocci Coccinelle semantic patch script. Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Deepak R Varma <drv@mailo.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
45bf79719f
commit
447395e18a
@ -577,8 +577,7 @@ void dcn3_clk_mgr_construct(
|
||||
|
||||
void dcn3_clk_mgr_destroy(struct clk_mgr_internal *clk_mgr)
|
||||
{
|
||||
if (clk_mgr->base.bw_params)
|
||||
kfree(clk_mgr->base.bw_params);
|
||||
kfree(clk_mgr->base.bw_params);
|
||||
|
||||
if (clk_mgr->wm_range_table)
|
||||
dm_helpers_free_gpu_mem(clk_mgr->base.ctx, DC_MEM_ALLOC_TYPE_GART,
|
||||
|
@ -783,8 +783,7 @@ void dcn32_clk_mgr_construct(
|
||||
|
||||
void dcn32_clk_mgr_destroy(struct clk_mgr_internal *clk_mgr)
|
||||
{
|
||||
if (clk_mgr->base.bw_params)
|
||||
kfree(clk_mgr->base.bw_params);
|
||||
kfree(clk_mgr->base.bw_params);
|
||||
|
||||
if (clk_mgr->wm_range_table)
|
||||
dm_helpers_free_gpu_mem(clk_mgr->base.ctx, DC_MEM_ALLOC_TYPE_GART,
|
||||
|
Loading…
x
Reference in New Issue
Block a user