libzfs: don't NULL-check infallible allocations

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13229
This commit is contained in:
наб
2022-03-16 19:51:28 +01:00
committed by Brian Behlendorf
parent bc3f12bfac
commit 18dbf5c8c3
13 changed files with 105 additions and 262 deletions
+2 -4
View File
@@ -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);