Illumos 6659 - nvlist_free(NULL) is a no-op

6659 nvlist_free(NULL) is a no-op
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Marcel Telka <marcel@telka.sk>
Approved by: Robert Mustacchi <rm@joyent.com>

References:
  https://www.illumos.org/issues/6659
  https://github.com/illumos/illumos-gate/commit/aab83bb

Ported-by: David Quigley <dpquigl@davequigley.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4566
This commit is contained in:
Josef 'Jeff' Sipek
2016-03-31 23:54:07 -04:00
committed by Brian Behlendorf
parent 16794374b3
commit 8a5fc74880
11 changed files with 19 additions and 39 deletions
+1 -2
View File
@@ -5294,8 +5294,7 @@ zfs_do_allow_unallow_impl(int argc, char **argv, boolean_t un)
cleanup0:
nvlist_free(perm_nvl);
if (update_perm_nvl != NULL)
nvlist_free(update_perm_nvl);
nvlist_free(update_perm_nvl);
cleanup1:
fs_perm_set_fini(&fs_perm_set);
cleanup2:
+2 -4
View File
@@ -3674,8 +3674,7 @@ zpool_do_split(int argc, char **argv)
if (add_prop_list(
zpool_prop_to_name(ZPOOL_PROP_ALTROOT), optarg,
&props, B_TRUE) != 0) {
if (props)
nvlist_free(props);
nvlist_free(props);
usage(B_FALSE);
}
break;
@@ -3688,8 +3687,7 @@ zpool_do_split(int argc, char **argv)
propval++;
if (add_prop_list(optarg, propval,
&props, B_TRUE) != 0) {
if (props)
nvlist_free(props);
nvlist_free(props);
usage(B_FALSE);
}
} else {
+1 -2
View File
@@ -1675,8 +1675,7 @@ split_mirror_vdev(zpool_handle_t *zhp, char *newname, nvlist_t *props,
}
if (zpool_vdev_split(zhp, newname, &newroot, props, flags) != 0) {
if (newroot != NULL)
nvlist_free(newroot);
nvlist_free(newroot);
return (NULL);
}