aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_inotify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c
index 94e65973a36b..10dd42ff1118 100644
--- a/sys/kern/vfs_inotify.c
+++ b/sys/kern/vfs_inotify.c
@@ -649,7 +649,7 @@ inotify_log_one(struct inotify_watch *watch, const char *name, size_t namelen,
* responsible for freeing it.
*/
key.wd = watch->wd;
- if (RB_FIND(inotify_watch_tree, &sc->watches, &key) != NULL) {
+ if (RB_FIND(inotify_watch_tree, &sc->watches, &key) == watch) {
RB_REMOVE(inotify_watch_tree, &sc->watches, watch);
inotify_unlink_watch_locked(sc, watch);