Print this page
6659 nvlist_free(NULL) is a no-op

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs4_state.c
          +++ new/usr/src/uts/common/fs/nfs/nfs4_state.c
↓ open down ↓ 1058 lines elided ↑ open up ↑
1059 1059  
1060 1060          /*
1061 1061           * If this is a "warm start", i.e. we previously had DSS paths,
1062 1062           * preserve the old paths.
1063 1063           */
1064 1064          if (rfs4_dss_paths != NULL) {
1065 1065                  /*
1066 1066                   * Before we lose the ptr, destroy the nvlist and pathnames
1067 1067                   * array from the warm start before this one.
1068 1068                   */
1069      -                if (rfs4_dss_oldpaths)
1070      -                        nvlist_free(rfs4_dss_oldpaths);
     1069 +                nvlist_free(rfs4_dss_oldpaths);
1071 1070                  rfs4_dss_oldpaths = rfs4_dss_paths;
1072 1071          }
1073 1072  
1074 1073          /* unpack the buffer into a searchable nvlist */
1075 1074          error = nvlist_unpack(buf, buflen, &rfs4_dss_paths, KM_SLEEP);
1076 1075          if (error)
1077 1076                  return (error);
1078 1077  
1079 1078          /*
1080 1079           * Search the nvlist for the pathnames nvpair (which is the only nvpair
↓ open down ↓ 377 lines elided ↑ open up ↑
1458 1457  
1459 1458          mutex_exit(&rfs4_state_lock);
1460 1459  
1461 1460          /* destroy server instances and current instance ptr */
1462 1461          rfs4_servinst_destroy_all();
1463 1462  
1464 1463          /* reset the "first NFSv4 request" status */
1465 1464          rfs4_seen_first_compound = 0;
1466 1465  
1467 1466          /* DSS: distributed stable storage */
1468      -        if (rfs4_dss_oldpaths)
1469      -                nvlist_free(rfs4_dss_oldpaths);
1470      -        if (rfs4_dss_paths)
1471      -                nvlist_free(rfs4_dss_paths);
     1467 +        nvlist_free(rfs4_dss_oldpaths);
     1468 +        nvlist_free(rfs4_dss_paths);
1472 1469          rfs4_dss_paths = rfs4_dss_oldpaths = NULL;
1473 1470  }
1474 1471  
1475 1472  typedef union {
1476 1473          struct {
1477 1474                  uint32_t start_time;
1478 1475                  uint32_t c_id;
1479 1476          } impl_id;
1480 1477          clientid4 id4;
1481 1478  } cid;
↓ open down ↓ 2533 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX