aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2012-11-27 14:02:49 -0800
committerBrian Behlendorf <[email protected]>2012-11-27 14:10:31 -0800
commitf74a147c022f79916e8525c2c16b1603f91202aa (patch)
treedee228b79894774032144e6475443ac83d4e0c48
parent30315d237bb23226476b348bc591589c80597351 (diff)
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1109
-rw-r--r--module/zfs/zvol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
index c3bd25c3b..5d4802560 100644
--- a/module/zfs/zvol.c
+++ b/module/zfs/zvol.c
@@ -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: