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>
This commit is contained in:
parent
319490fb7b
commit
58f3c42e6d
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user