mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Reference in a new issue