Whamcloud - gitweb
LU-4423 lnet: check for null pointer at line 1569 of router.c 93/15093/2
authorJames Simmons <uja.ornl@yahoo.com>
Mon, 1 Jun 2015 01:50:40 +0000 (21:50 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 10 Jun 2015 03:23:50 +0000 (03:23 +0000)
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 <oleg.drokin@intel.com>
CC: Dmitry Eremin <dmitry.eremin@intel.com>
CC: Liang Zhen <liang.zhen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Change-Id: I00c8f9f1d4ebd55d6c6f27943e59db7fb1adb525
Reviewed-on: http://review.whamcloud.com/15093
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
lnet/lnet/router.c

index f611f31..6699245 100644 (file)
@@ -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;