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: v4.14-rc1~7083^2~39^2~1111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d36175e9d2c986ee653277928bfcbab6ddf6bb85;p=platform%2Fkernel%2Flinux-rpi.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 995f509..926923a 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;