Fix a use-after-free when "zpool import" fails
authorasomers <asomers@FreeBSD.org>
Fri, 29 Apr 2016 21:29:37 +0000 (21:29 +0000)
committerasomers <asomers@FreeBSD.org>
Fri, 29 Apr 2016 21:29:37 +0000 (21:29 +0000)
commit440da718c9dc48658f711bb6161851b88d9694de
treec9bf6eba45b7a0211e28dc710a46e32352b029fc
parent79a1fafeb42e583ed21b9d628a7f5843af2363c6
Fix a use-after-free when "zpool import" fails

clear vd->vdev_tsd in vdev_geom_close_locked instead of vdev_geom_detach.
In the latter function, it would fail to happen in certain circumstances
where cp->private was unset.  Ideally, the latter should never happen, but
it can happen when vdev open fails, or where spares are involved.

MFC after: 4 weeks
X-MFC-With: 298786
Sponsored by: Spectra Logic Corp
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c