[lustre-devel] [PATCH 31/34] LU-7734 lnet: fix NULL access in lnet_peer_aliveness_enabled

NeilBrown neilb at suse.com
Mon Sep 24 18:07:16 PDT 2018


From: Amir Shehata <amir.shehata at intel.com>

When a peer is not on a local network, lpni->lpni_net is NULL.
The lpni_net is access in lnet_peer_aliveness_enabled() without
checking if it's NULL. Fixed.

Test-Parameters: trivial
Signed-off-by: Amir Shehata <amir.shehata at intel.com>
Change-Id: If328728e2bda2a19b273140a20c04b22bdda6bc4
Reviewed-on: http://review.whamcloud.com/22183
Tested-by: Maloo <hpdd-maloo at intel.com>
Reviewed-by: Olaf Weber <olaf at sgi.com>
Signed-off-by: NeilBrown <neilb at suse.com>
---
 .../staging/lustre/include/linux/lnet/lib-types.h  |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 2d73aa1a121c..f811f125dfcb 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -534,6 +534,7 @@ struct lnet_peer_table {
  */
 #define lnet_peer_aliveness_enabled(lp)				\
 	(the_lnet.ln_routing &&					\
+	 (lp)->lpni_net &&					\
 	 (lp)->lpni_net->net_tunables.lct_peer_timeout > 0)
 
 struct lnet_route {




More information about the lustre-devel mailing list