mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
zvol_os: Don't leak doi in cdev error path
Make sure to free doi in zvol_create_minor impl when make_dev_s fails. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Matt Macy <mmacy@FreeBSD.org> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #11117
This commit is contained in:
parent
9a0ef216e5
commit
277884ab42
@ -1328,7 +1328,7 @@ zvol_create_minor_impl(const char *name)
|
||||
mutex_destroy(&zv->zv_state_lock);
|
||||
kmem_free(zv, sizeof (*zv));
|
||||
dmu_objset_disown(os, B_TRUE, FTAG);
|
||||
goto out_giant;
|
||||
goto out_doi;
|
||||
}
|
||||
dev->si_iosize_max = MAXPHYS;
|
||||
zsd->zsd_cdev = dev;
|
||||
@ -1372,7 +1372,6 @@ out_doi:
|
||||
rw_exit(&zvol_state_lock);
|
||||
ZFS_LOG(1, "ZVOL %s created.", name);
|
||||
}
|
||||
out_giant:
|
||||
PICKUP_GIANT();
|
||||
return (error);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user