From: zhong jiang Date: Fri, 21 Sep 2018 13:12:11 +0000 (+0800) Subject: drm/amd/display: remove redundant null pointer check before kfree X-Git-Tag: v5.4-rc1~2273^2~20^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2faec55c4d972a87a420301ec9e4556c79ee8b54;p=platform%2Fkernel%2Flinux-rpi.git drm/amd/display: remove redundant null pointer check before kfree kfree has taken the null pointer into account. hence it is safe to remove the redundant null pointer check before kfree. Signed-off-by: zhong jiang Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/modules/stats/stats.c b/drivers/gpu/drm/amd/display/modules/stats/stats.c index 3d4c1b1..03121ca 100644 --- a/drivers/gpu/drm/amd/display/modules/stats/stats.c +++ b/drivers/gpu/drm/amd/display/modules/stats/stats.c @@ -186,12 +186,8 @@ void mod_stats_destroy(struct mod_stats *mod_stats) if (mod_stats != NULL) { struct core_stats *core_stats = MOD_STATS_TO_CORE(mod_stats); - if (core_stats->time != NULL) - kfree(core_stats->time); - - if (core_stats->events != NULL) - kfree(core_stats->events); - + kfree(core_stats->time); + kfree(core_stats->events); kfree(core_stats); } }