From: Oleg Drokin Date: Mon, 28 Apr 2014 02:25:58 +0000 (-0400) Subject: staging/lustre/lnet: fix potential null pointer dereference X-Git-Tag: firefly_0821_release~176^2~3465^2~39^2~1111 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d36175e9d2c986ee653277928bfcbab6ddf6bb85;p=firefly-linux-kernel-4.4.55.git staging/lustre/lnet: fix potential null pointer dereference 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. found by Klocwork Insight tool Signed-off-by: Oleg Drokin CC: Dmitry Eremin CC: Liang Zhen 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 995f50976c42..926923a104c5 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -145,7 +145,7 @@ lnet_ni_notify_locked(lnet_ni_t *ni, lnet_peer_t *lp) * NB individual events can be missed; the only guarantee is that you * always get the most recent news */ - if (lp->lp_notifying) + if (lp->lp_notifying || ni == NULL) return; lp->lp_notifying = 1;