From 7c99c092664baa1c325ff3e13c43bdb6945d963d Mon Sep 17 00:00:00 2001 From: sharmaso Date: Wed, 8 Feb 2017 14:42:01 -0800 Subject: [PATCH] LU-9077 lnet: fix for static analysis issues fixes the 11 static analysis issues found in v2_9_52_0-66-gec839d4. 1. lustre_lnet_show_numa_range - fixed 2. lnet_select_pathway - fixed 3. lustre_lnet_show_discovery - fixed 4. lnet_discover_peer_locked - false positive 5. lustre_lnet_ping_nid - fixed 6. lustre_lnet_ping_nid - false positive 7. lustre_lnet_show_discovery - duplicate of 3 8. lustre_lnet_show_max_intf - fixed 9. lustre_lnet_show_max_intf - duplicate of 8 10. lnet_peer_set_primary_data - false positive 11. lustre_lnet_show_numa_range - fixed Test-Parameters: trivial Signed-off-by: Sonia Sharma Signed-off-by: Olaf Weber Change-Id: I4cb03e4f64cd0c743ee3646f4628d34533b2d4ba Reviewed-on: https://review.whamcloud.com/25792 Reviewed-by: Olaf Weber Reviewed-by: Amir Shehata Tested-by: Amir Shehata --- lnet/lnet/lib-move.c | 1 + lnet/utils/lnetconfig/liblnetconfig.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index b97abb1..e9b7953 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -1610,6 +1610,7 @@ again: /* Get the target peer_ni */ peer_net = lnet_peer_get_net_locked(peer, LNET_NIDNET(best_lpni->lpni_nid)); + LASSERT(peer_net != NULL); list_for_each_entry(lpni, &peer_net->lpn_peer_nis, lpni_peer_nis) { if (lpni->lpni_pref_nnids == 0) diff --git a/lnet/utils/lnetconfig/liblnetconfig.c b/lnet/utils/lnetconfig/liblnetconfig.c index bee4a29..bc545d8 100644 --- a/lnet/utils/lnetconfig/liblnetconfig.c +++ b/lnet/utils/lnetconfig/liblnetconfig.c @@ -2706,6 +2706,8 @@ int lustre_lnet_show_max_intf(int seq_no, struct cYAML **show_rc, cYAML_print_tree(root); snprintf(err_str, sizeof(err_str), "\"success\""); + rc = LUSTRE_CFG_RC_NO_ERR; + out: if (show_rc == NULL || rc != LUSTRE_CFG_RC_NO_ERR) cYAML_free_tree(root); @@ -2760,6 +2762,9 @@ int lustre_lnet_show_discovery(int seq_no, struct cYAML **show_rc, cYAML_print_tree(root); snprintf(err_str, sizeof(err_str), "\"success\""); + + rc = LUSTRE_CFG_RC_NO_ERR; + out: if (show_rc == NULL || rc != LUSTRE_CFG_RC_NO_ERR) { cYAML_free_tree(root); -- 1.8.3.1