vfs: flip a condition around in kern_statat

error tends to be 0.
This commit is contained in:
Mateusz Guzik 2022-09-07 22:05:32 +02:00
parent c4e591c9ab
commit 3e0b486886

View File

@ -2450,9 +2450,10 @@ kern_statat(struct thread *td, int flag, int fd, const char *path,
return (error);
}
error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED);
if (error == 0) {
if (__predict_false(hook != NULL))
if (__predict_false(hook != NULL)) {
if (error == 0) {
hook(nd.ni_vp, sbp);
}
}
NDFREE_NOTHING(&nd);
vput(nd.ni_vp);