1
0
Fork 0

staging: lustre: mdc: remove unneeded null test before free

Kfree can cope with a null argument, so drop null tests.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression ptr; @@

- if (ptr != NULL)
  kfree(ptr);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Julia Lawall 2015-05-01 21:37:56 +02:00 committed by Greg Kroah-Hartman
parent 34b8fbd6cd
commit 6fa7cbab38
1 changed files with 1 additions and 2 deletions

View File

@ -1644,8 +1644,7 @@ out:
llog_cat_close(NULL, llh);
if (ctxt)
llog_ctxt_put(ctxt);
if (cs->cs_buf)
kfree(cs->cs_buf);
kfree(cs->cs_buf);
kfree(cs);
return rc;
}