vfs: correctly predict last fdrop on failed open

Arguably since the count is guaranteed to be 1 the code should be modified
to avoid the work.
This commit is contained in:
Mateusz Guzik 2020-12-13 21:28:15 +00:00
parent 203affb291
commit d48c2b8d29
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=368614

View file

@ -1229,7 +1229,7 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
return (0);
bad:
KASSERT(indx == -1, ("indx=%d, should be -1", indx));
fdrop(fp, td);
fdrop_close(fp, td);
return (error);
}