From: Dmitry Eremin Date: Wed, 2 Mar 2016 22:01:56 +0000 (-0500) Subject: staging: lustre: fix api-ni.c issues found by Klocwork Insight tool X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=72159bb6a0471281d6bac3bef0168953952ab254;p=linux-beck.git staging: lustre: fix api-ni.c issues found by Klocwork Insight tool Pointer 'ni' checked for NULL at line 1569 may be passed to function and may be dereferenced there by passing argument 1 to function 'lnet_ni_notify_locked' at line 1621. Signed-off-by: Dmitry Eremin Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629 Reviewed-on: http://review.whamcloud.com/9386 Reviewed-by: John L. Hammond Reviewed-by: Isaac Huang Reviewed-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 9543ba3b781a..6a446010eda8 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -1800,7 +1800,8 @@ lnet_notify(lnet_ni_t *ni, lnet_nid_t nid, int alive, unsigned long when) lnet_notify_locked(lp, !ni, alive, when); - lnet_ni_notify_locked(ni, lp); + if (ni) + lnet_ni_notify_locked(ni, lp); lnet_peer_decref_locked(lp);