Whamcloud - gitweb
LU-9077 lnet: fix for static analysis issues 92/25792/29
authorsharmaso <sonia.sharma@intel.com>
Wed, 8 Feb 2017 22:42:01 +0000 (14:42 -0800)
committerAmir Shehata <amir.shehata@intel.com>
Tue, 22 Aug 2017 16:27:46 +0000 (16:27 +0000)
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 <sonia.sharma@intel.com>
Signed-off-by: Olaf Weber <olaf@sgi.com>
Change-Id: I4cb03e4f64cd0c743ee3646f4628d34533b2d4ba
Reviewed-on: https://review.whamcloud.com/25792
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Tested-by: Amir Shehata <amir.shehata@intel.com>
lnet/lnet/lib-move.c
lnet/utils/lnetconfig/liblnetconfig.c

index b97abb1..e9b7953 100644 (file)
@@ -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)
index bee4a29..bc545d8 100644 (file)
@@ -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);