diff mbox series

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

Message ID 153783763604.32103.1694406227193499062.stgit@noble (mailing list archive)
State New, archived
Headers show
Series lustre: remainder of multi-rail series. | expand

Commit Message

NeilBrown Sept. 25, 2018, 1:07 a.m. UTC
From: Amir Shehata <amir.shehata@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@intel.com>
Change-Id: If328728e2bda2a19b273140a20c04b22bdda6bc4
Reviewed-on: http://review.whamcloud.com/22183
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Signed-off-by: NeilBrown <neilb@suse.com>
---
 .../staging/lustre/include/linux/lnet/lib-types.h  |    1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

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 {