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:
pjd 2012-06-13 21:38:07 +00:00
parent f695b590b4
commit 0123f7ed5a

View File

@ -1237,8 +1237,7 @@ success:
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);
}