diff options
author | наб <[email protected]> | 2022-03-16 19:51:28 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-03-30 15:30:16 -0700 |
commit | 18dbf5c8c34b1a412480dcfed2bdbefbafd80d80 (patch) | |
tree | 1d55cfadb6d4b5ff147d5fd06d68b0c0da33451b /lib/libzfs/os/freebsd/libzfs_compat.c | |
parent | bc3f12bfac152a0c28951cec92340ba14f9ccee9 (diff) |
libzfs: don't NULL-check infallible allocations
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #13229
Diffstat (limited to 'lib/libzfs/os/freebsd/libzfs_compat.c')
-rw-r--r-- | lib/libzfs/os/freebsd/libzfs_compat.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libzfs/os/freebsd/libzfs_compat.c b/lib/libzfs/os/freebsd/libzfs_compat.c index a4b30df85..d2bc6ddfc 100644 --- a/lib/libzfs/os/freebsd/libzfs_compat.c +++ b/lib/libzfs/os/freebsd/libzfs_compat.c @@ -338,15 +338,13 @@ zpool_nextboot(libzfs_handle_t *hdl, uint64_t pool_guid, uint64_t dev_guid, { zfs_cmd_t zc = {"\0"}; nvlist_t *args; - int error; args = fnvlist_alloc(); fnvlist_add_uint64(args, ZPOOL_CONFIG_POOL_GUID, pool_guid); fnvlist_add_uint64(args, ZPOOL_CONFIG_GUID, dev_guid); fnvlist_add_string(args, "command", command); - error = zcmd_write_src_nvlist(hdl, &zc, args); - if (error == 0) - error = zfs_ioctl(hdl, ZFS_IOC_NEXTBOOT, &zc); + zcmd_write_src_nvlist(hdl, &zc, args); + int error = zfs_ioctl(hdl, ZFS_IOC_NEXTBOOT, &zc); zcmd_free_nvlists(&zc); nvlist_free(args); return (error); |