summaryrefslogtreecommitdiffstats
path: root/sys/dev/md
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-06-15 19:18:43 +0000
committerphk <phk@FreeBSD.org>2002-06-15 19:18:43 +0000
commit06a5147771dbf233786cce0382f17e67d2d7ad34 (patch)
treeb673520754c3613f02498100cd6d764f9e001578 /sys/dev/md
parent12d0065cbf0fb7325119c8dc10021c5277098f44 (diff)
downloadFreeBSD-src-06a5147771dbf233786cce0382f17e67d2d7ad34.zip
FreeBSD-src-06a5147771dbf233786cce0382f17e67d2d7ad34.tar.gz
mdcreate_vnode() isn't correctly clearing things out of the linked
list if the file is of 0 size or mdsetcred() fails. Submitted by: Martin Faxer <gmh003532@brfmasthugget.se>
Diffstat (limited to 'sys/dev/md')
-rw-r--r--sys/dev/md/md.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 29158de..9c2e227 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -858,12 +858,12 @@ mdcreate_vnode(struct md_ioctl *mdio, struct thread *td)
else
sc->nsect = vattr.va_size / sc->secsize; /* XXX: round up ? */
if (sc->nsect == 0) {
- (void) vn_close(nd.ni_vp, flags, td->td_ucred, td);
+ mddestroy(sc, td);
return (EINVAL);
}
error = mdsetcred(sc, td->td_ucred);
if (error) {
- (void) vn_close(nd.ni_vp, flags, td->td_ucred, td);
+ mddestroy(sc, td);
return (error);
}
mdinit(sc);
OpenPOWER on IntegriCloud