* [PATCH] staging: lustre: lnet: remove null check before kfree
@ 2018-01-20 8:09 Sumit Pundir
0 siblings, 0 replies; only message in thread
From: Sumit Pundir @ 2018-01-20 8:09 UTC (permalink / raw)
To: oleg.drokin; +Cc: devel, gregkh, linux-kernel, andreas.dilger, lustre-devel
Since kfree(NULL) is safe there is no need to place a check before it.
Issue reported by checkpatch.pl
Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>
---
drivers/staging/lustre/lnet/lnet/lib-move.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index d724c4c..c673037 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -2146,8 +2146,7 @@ lnet_create_reply_msg(struct lnet_ni *ni, struct lnet_msg *getmsg)
the_lnet.ln_counters[cpt]->drop_length += getmd->md_length;
lnet_net_unlock(cpt);
- if (msg)
- kfree(msg);
+ kfree(msg);
return NULL;
}
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-01-20 8:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-20 8:09 [PATCH] staging: lustre: lnet: remove null check before kfree Sumit Pundir
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®