Fix NULL deref when zvol_alloc() fails
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 27 Nov 2012 22:02:49 +0000 (14:02 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 27 Nov 2012 22:10:31 +0000 (14:10 -0800)
commitf74a147c022f79916e8525c2c16b1603f91202aa
treedee228b79894774032144e6475443ac83d4e0c48
parent30315d237bb23226476b348bc591589c80597351
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
module/zfs/zvol.c