Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <zhongjiang@huawei.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

zhong jiang and committed by
Alex Deucher
2faec55c 505f8dbb

+2 -6
+2 -6
drivers/gpu/drm/amd/display/modules/stats/stats.c
··· 186 186 if (mod_stats != NULL) { 187 187 struct core_stats *core_stats = MOD_STATS_TO_CORE(mod_stats); 188 188 189 - if (core_stats->time != NULL) 190 - kfree(core_stats->time); 191 - 192 - if (core_stats->events != NULL) 193 - kfree(core_stats->events); 194 - 189 + kfree(core_stats->time); 190 + kfree(core_stats->events); 195 191 kfree(core_stats); 196 192 } 197 193 }