From 33e1ff95e8cee4f7bce251754020a7ec0be37a96 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Sun, 31 May 2015 21:50:40 -0400 Subject: [PATCH 1/1] LU-4423 lnet: check for null pointer at line 1569 of router.c Linux commit: d36175e9d2c986ee653277928bfcbab6ddf6bb85 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 Signed-off-by: James Simmons Change-Id: I00c8f9f1d4ebd55d6c6f27943e59db7fb1adb525 Reviewed-on: http://review.whamcloud.com/15093 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Isaac Huang --- lnet/lnet/router.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnet/lnet/router.c b/lnet/lnet/router.c index f611f31..6699245 100644 --- a/lnet/lnet/router.c +++ b/lnet/lnet/router.c @@ -136,7 +136,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; -- 1.8.3.1