diff options
author | наб <[email protected]> | 2022-02-20 04:06:43 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-03-04 12:08:33 -0800 |
commit | f4826a2d4676e0b4133e7bd05ee051b7842d6478 (patch) | |
tree | 6c8bcd6f8016e1f63ddf2773f43a3b982dd1fde0 /lib | |
parent | be8e1d81bf2b85f6f76851b7013ac54e9bf488f0 (diff) |
libzfs: util: don't check for allocation errors from infallible zfs_*()
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #13125
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzfs/libzfs_util.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index 3e33ef503..f38eeb512 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -1778,16 +1778,10 @@ addlist(libzfs_handle_t *hdl, char *propname, zprop_list_t **listp, dgettext(TEXT_DOMAIN, "bad property list"))); } - if ((entry = zfs_alloc(hdl, sizeof (zprop_list_t))) == NULL) - return (-1); - + entry = zfs_alloc(hdl, sizeof (zprop_list_t)); entry->pl_prop = prop; if (prop == ZPROP_INVAL) { - if ((entry->pl_user_prop = zfs_strdup(hdl, propname)) == - NULL) { - free(entry); - return (-1); - } + entry->pl_user_prop = zfs_strdup(hdl, propname); entry->pl_width = strlen(propname); } else { entry->pl_width = zprop_width(prop, &entry->pl_fixed, @@ -1951,9 +1945,7 @@ zprop_expand_list(libzfs_handle_t *hdl, zprop_list_t **plp, zfs_type_t type) * Add 'name' to the beginning of the list, which is handled * specially. */ - if ((entry = zfs_alloc(hdl, sizeof (zprop_list_t))) == NULL) - return (-1); - + entry = zfs_alloc(hdl, sizeof (zprop_list_t)); entry->pl_prop = ((type == ZFS_TYPE_POOL) ? ZPOOL_PROP_NAME : ((type == ZFS_TYPE_VDEV) ? VDEV_PROP_NAME : ZFS_PROP_NAME)); entry->pl_width = zprop_width(entry->pl_prop, |