From d36175e9d2c986ee653277928bfcbab6ddf6bb85 Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Sun, 27 Apr 2014 22:25:58 -0400 Subject: [PATCH] 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 --- drivers/staging/lustre/lnet/lnet/router.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.20.1