drm/amd/display: remove redundant null pointer check before kfree
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 18ebd398-9eeb-54e7-96ff-19a1c34bdcd3-5C7GfCeVMHo@public.gmane.org
Quoted 5 lines · Harry Wentland
Quoted 3 lines · zhong jiang
kfree has taken the null pointer into account. hence it is safe to remove the redundant null pointer check before kfree.
Please send patches for
drivers/gpu/drm/amdto [email protected] for review.
+cc [email protected]. Do I need to resend it ?
Sincerely,
zhong jiang
Quoted 15 lines
Harry
Quoted 13 lines
Signed-off-by zhong jiang <[email protected]>--- drivers/gpu/drm/amd/display/modules/stats/stats.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/display/modules/stats/stats.c +0
-0@@ -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);
Quoted 13 lines
drivers/gpu/drm/amd/display/modules/stats/stats.c void mod_stats_destroy(struct mod_stats *mod_stats) · line 193
Quoted 12 lines
drivers/gpu/drm/amd/display/modules/stats/stats.c +2
-6-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); } }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Harry Wentland
Reviewed-byQuoted 8 lines · zhong jiang
Quoted 5 lines · Harry Wentland
Quoted 3 lines · zhong jiang
kfree has taken the null pointer into account. hence it is safe to remove the redundant null pointer check before kfree.
Please send patches for
drivers/gpu/drm/amdto [email protected] for review.+cc [email protected]. Do I need to resend it ?
Thanks. No need this time. Next time send to amd-gfx directly.
I'll pull it in.
Harry
Quoted 32 lines
Sincerely,
zhong jiangQuoted 28 lines
Harry
Quoted 25 lines
Signed-off-by zhong jiang <[email protected]>--- drivers/gpu/drm/amd/display/modules/stats/stats.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/display/modules/stats/stats.c +2
-6@@ -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); } }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx