fs: dlm: lockspace.c: removal of unnecessary check before calling kfree()
Subsystems (2)
PATCH 1/1 fs: dlm: lockspace.c: removal of unnecessary check before calling kfree()
kfree() checks its argument. It is therefore unnecessary to do this twice.
This issue was detected using Coccinelle.
--- fs/dlm/lockspace.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/dlm/lockspace.c +1 -2
@@ -674,8 +674,7 @@ static int new_lockspace(const char *name, const char *cluster, out_lkbidr:idr_destroy (&ls->ls_lkbidr);for (i =0 ; i <DLM_REMOVE_NAMES_MAX ; i++) { -if (ls->ls_remove_names[i]) -kfree (ls->ls_remove_names[i]); +kfree (ls->ls_remove_names[i]); } out_rsbtbl:vfree (ls->ls_rsbtbl);
Signature · 1 line
2.1.0
Quoted 3 lines
kfree()checks its argument. It is therefore unnecessary to do this twice.This issue was detected using Coccinelle.
Would you like to integrate my update suggestion 'fs-DLM: Deletion of unnecessary checks before the function call "kfree"'?
https://lkml.org/lkml/2014/11/29/88
http://article.gmane.org/gmane.linux.kernel/1840524
https://www.mail-archive.com/linux-kernel at vger.kernel.org/msg778279.html
Regards,
Markus
2015-02-11 13:10 GMT+01:00 SF Markus Elfring <[email protected]>:
Quoted 9 lines
Quoted 3 lines
kfree()checks its argument. It is therefore unnecessary to do this twice.This issue was detected using Coccinelle.
Would you like to integrate my update suggestion 'fs-DLM: Deletion of unnecessary checks before the function call "kfree"'?
https://lkml.org/lkml/2014/11/29/88
http://article.gmane.org/gmane.linux.kernel/1840524
https://www.mail-archive.com/linux-kernel at vger.kernel.org/msg778279.html
I'll drop that too :)
Quoted 3 lines
Regards,
Markus
Quoted 5 lines
Quoted 3 lines
https://lkml.org/lkml/2014/11/29/88
http://article.gmane.org/gmane.linux.kernel/1840524
https://www.mail-archive.com/linux-kernel at vger.kernel.org/msg778279.htmlI'll drop that too :)
Would you like to add any tags to my update suggestion?
Are you looking for more opportunities around clean-up of such safety checks in Linux source code?
Regards,
Markus