diff options
author | zhong jiang <zhongjiang@huawei.com> | 2018-09-21 09:12:11 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-09-26 22:09:12 -0400 |
commit | 2faec55c4d972a87a420301ec9e4556c79ee8b54 (patch) | |
tree | 5b90fa9b5cb0dca9017c3e4ed054cd9acb2bcd71 | |
parent | 505f8dbb6a58873559ae38f2320f9bea4f3ab825 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/stats/stats.c | 8 |
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) | |||
186 | if (mod_stats != NULL) { | 186 | if (mod_stats != NULL) { |
187 | struct core_stats *core_stats = MOD_STATS_TO_CORE(mod_stats); | 187 | struct core_stats *core_stats = MOD_STATS_TO_CORE(mod_stats); |
188 | 188 | ||
189 | if (core_stats->time != NULL) | 189 | kfree(core_stats->time); |
190 | kfree(core_stats->time); | 190 | kfree(core_stats->events); |
191 | |||
192 | if (core_stats->events != NULL) | ||
193 | kfree(core_stats->events); | ||
194 | |||
195 | kfree(core_stats); | 191 | kfree(core_stats); |
196 | } | 192 | } |
197 | } | 193 | } |