Skip to content

Commit

Permalink
drm/amd/display: remove no need NULL check before kfree
Browse files Browse the repository at this point in the history
This change is to cleanup the code a bit.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Bernard Zhao <bernard@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Bernard Zhao authored and Alex Deucher committed Nov 22, 2021
1 parent 7b833d6 commit 13d20aa
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,10 +978,8 @@ static void dcn10_resource_destruct(struct dcn10_resource_pool *pool)
pool->base.mpc = NULL;
}

if (pool->base.hubbub != NULL) {
kfree(pool->base.hubbub);
pool->base.hubbub = NULL;
}
kfree(pool->base.hubbub);
pool->base.hubbub = NULL;

for (i = 0; i < pool->base.pipe_count; i++) {
if (pool->base.opps[i] != NULL)
Expand Down Expand Up @@ -1011,14 +1009,10 @@ static void dcn10_resource_destruct(struct dcn10_resource_pool *pool)
for (i = 0; i < pool->base.res_cap->num_ddc; i++) {
if (pool->base.engines[i] != NULL)
dce110_engine_destroy(&pool->base.engines[i]);
if (pool->base.hw_i2cs[i] != NULL) {
kfree(pool->base.hw_i2cs[i]);
pool->base.hw_i2cs[i] = NULL;
}
if (pool->base.sw_i2cs[i] != NULL) {
kfree(pool->base.sw_i2cs[i]);
pool->base.sw_i2cs[i] = NULL;
}
kfree(pool->base.hw_i2cs[i]);
pool->base.hw_i2cs[i] = NULL;
kfree(pool->base.sw_i2cs[i]);
pool->base.sw_i2cs[i] = NULL;
}

for (i = 0; i < pool->base.audio_count; i++) {
Expand Down

0 comments on commit 13d20aa

Please sign in to comment.