diff options
-rw-r--r-- | sys/kern/vfs_syscalls.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index c40d1092574e..85f85c5f1a99 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -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); |