mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
Fix NULL deref when zvol_alloc() fails
If zvol_alloc() fails zv will be set to NULL and dereferenced in out_dmu_objset_disown. To avoid this entirely the zv->objset line is moved up in to the success block. Original-patch-by: Jorgen Lundman <lundman@lundman.net> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1109
This commit is contained in:
parent
30315d237b
commit
f74a147c02
@ -1306,9 +1306,9 @@ __zvol_create_minor(const char *name)
|
|||||||
else
|
else
|
||||||
zil_replay(os, zv, zvol_replay_vector);
|
zil_replay(os, zv, zvol_replay_vector);
|
||||||
|
|
||||||
|
zv->zv_objset = NULL;
|
||||||
out_dmu_objset_disown:
|
out_dmu_objset_disown:
|
||||||
dmu_objset_disown(os, zvol_tag);
|
dmu_objset_disown(os, zvol_tag);
|
||||||
zv->zv_objset = NULL;
|
|
||||||
out_doi:
|
out_doi:
|
||||||
kmem_free(doi, sizeof(dmu_object_info_t));
|
kmem_free(doi, sizeof(dmu_object_info_t));
|
||||||
out:
|
out:
|
||||||
|
Loading…
Reference in New Issue
Block a user