mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user