From: Amir Shehata Date: Fri, 26 Aug 2016 19:39:27 +0000 (-0700) Subject: LU-7734 lnet: fix NULL access in lnet_peer_aliveness_enabled X-Git-Tag: 2.9.53~47^2~5 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f85f1cd257871a7a54600463a7f6f6ad1513f37e LU-7734 lnet: fix NULL access in lnet_peer_aliveness_enabled 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 Change-Id: If328728e2bda2a19b273140a20c04b22bdda6bc4 Reviewed-on: http://review.whamcloud.com/22183 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Olaf Weber --- diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index 588ea00..0e78fb2 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -562,7 +562,8 @@ struct lnet_peer_table { /* peer aliveness is enabled only on routers for peers in a network where the * lnet_ni_t::ni_peertimeout has been set to a positive value */ #define lnet_peer_aliveness_enabled(lp) (the_lnet.ln_routing != 0 && \ - (lp)->lpni_net->net_tunables.lct_peer_timeout > 0) + ((lp)->lpni_net) && \ + (lp)->lpni_net->net_tunables.lct_peer_timeout > 0) typedef struct { struct list_head lr_list; /* chain on net */