diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/inotify.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/inotify.c b/fs/inotify.c index 7d5725336527..732ec4bd5774 100644 --- a/fs/inotify.c +++ b/fs/inotify.c | |||
@@ -894,8 +894,7 @@ static int inotify_ignore(struct inotify_device *dev, s32 wd) | |||
894 | mutex_lock(&dev->mutex); | 894 | mutex_lock(&dev->mutex); |
895 | 895 | ||
896 | /* make sure that we did not race */ | 896 | /* make sure that we did not race */ |
897 | watch = idr_find(&dev->idr, wd); | 897 | if (likely(idr_find(&dev->idr, wd) == watch)) |
898 | if (likely(watch)) | ||
899 | remove_watch(watch, dev); | 898 | remove_watch(watch, dev); |
900 | 899 | ||
901 | mutex_unlock(&dev->mutex); | 900 | mutex_unlock(&dev->mutex); |