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
|
||||
zil_replay(os, zv, zvol_replay_vector);
|
||||
|
||||
zv->zv_objset = NULL;
|
||||
out_dmu_objset_disown:
|
||||
dmu_objset_disown(os, zvol_tag);
|
||||
zv->zv_objset = NULL;
|
||||
out_doi:
|
||||
kmem_free(doi, sizeof(dmu_object_info_t));
|
||||
out:
|
||||
|
Loading…
Reference in New Issue
Block a user