1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Now that dupfdopen() doesn't depend on finstall() being called earlier,

indx will never be -1 on error, as none of dupfdopen(), finstall() and
kern_capwrap() modifies it on error, but what is more important none of
those functions install and leave file at indx descriptor on error.

Leave an assert to prove my words.

MFC after:	1 month
This commit is contained in:
Pawel Jakub Dawidek 2012-06-13 21:38:07 +00:00
parent 3812dcd3de
commit 7080f124d2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=237034

View File

@ -1237,8 +1237,7 @@ kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg,
bad:
VFS_UNLOCK_GIANT(vfslocked);
bad_unlocked:
if (indx != -1)
fdclose(fdp, fp, indx, td);
KASSERT(indx == -1, ("indx=%d, should be -1", indx));
fdrop(fp, td);
return (error);
}