Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / obdclass / lprocfs_status.c
index 239b00d..9e6768b 100644 (file)
@@ -1694,7 +1694,6 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
                                    lprocfs_exp_rd_hash, NULL, new_stat, NULL);
         if (IS_ERR(entry)) {
                 CWARN("Error adding the hash file\n");
-                lprocfs_remove(&new_stat->nid_proc);
                 rc = PTR_ERR(entry);
                 GOTO(destroy_new_ns, rc);
         }
@@ -1709,6 +1708,8 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
         RETURN(rc);
 
 destroy_new_ns:
+        if (new_stat->nid_proc != NULL)
+                lprocfs_remove(&new_stat->nid_proc);
         lustre_hash_del(obd->obd_nid_stats_hash, nid, &new_stat->nid_hash);
         OBD_FREE_PTR(new_ns_uuid);