summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorzhong jiang2018-09-21 15:12:11 +0200
committerAlex Deucher2018-09-27 04:09:12 +0200
commit2faec55c4d972a87a420301ec9e4556c79ee8b54 (patch)
tree5b90fa9b5cb0dca9017c3e4ed054cd9acb2bcd71 /drivers/gpu/drm/amd
parentdrm/amdgpu: print smc feature mask in debugfs amdgpu_pm_info (diff)
downloadkernel-qcow2-linux-2faec55c4d972a87a420301ec9e4556c79ee8b54.tar.gz
kernel-qcow2-linux-2faec55c4d972a87a420301ec9e4556c79ee8b54.tar.xz
kernel-qcow2-linux-2faec55c4d972a87a420301ec9e4556c79ee8b54.zip
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>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/display/modules/stats/stats.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/stats/stats.c b/drivers/gpu/drm/amd/display/modules/stats/stats.c
index 3d4c1b1ab8c4..03121ca64fe4 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);
}
}