summaryrefslogtreecommitdiffstats
path: root/sys/dev/md
diff options
context:
space:
mode:
authorphilip <philip@FreeBSD.org>2008-02-28 18:31:54 +0000
committerphilip <philip@FreeBSD.org>2008-02-28 18:31:54 +0000
commita5ef2c95a1b3d11082cf8aaa215a66128df5e858 (patch)
treee5c4c4147e9c98fff853aa3f601350d7be627479 /sys/dev/md
parentdd53c63465ee5e2ff3496d9c5cd514a11a5431c1 (diff)
downloadFreeBSD-src-a5ef2c95a1b3d11082cf8aaa215a66128df5e858.zip
FreeBSD-src-a5ef2c95a1b3d11082cf8aaa215a66128df5e858.tar.gz
Zero sc->vnode if mdsetcred() fails.
This fixes the panic which happens when mdcreate_vnode() calls vn_close() and mddestroy() calls it again further down the error handling path. Reviewed by: kris, kib MFC after: 3 days
Diffstat (limited to 'sys/dev/md')
-rw-r--r--sys/dev/md/md.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 8e91c6f..639f4d8 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -947,6 +947,7 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td)
error = mdsetcred(sc, td->td_ucred);
if (error != 0) {
+ sc->vnode = NULL;
vn_lock(nd.ni_vp, LK_EXCLUSIVE | LK_RETRY);
nd.ni_vp->v_vflag &= ~VV_MD;
VOP_UNLOCK(nd.ni_vp, 0);
OpenPOWER on IntegriCloud