Commit d66fd908 authored by Amy Griffis's avatar Amy Griffis Committed by Linus Torvalds
Browse files

[PATCH] fix NULL dereference in inotify_ignore

Don't reassign to watch.  If idr_find() returns NULL, then
put_inotify_watch() will choke.
Signed-off-by: default avatarAmy Griffis <>
Cc: John McCutchan <>
Cc: Robert Love <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 66055a4e
......@@ -894,8 +894,7 @@ static int inotify_ignore(struct inotify_device *dev, s32 wd)
/* make sure that we did not race */
watch = idr_find(&dev->idr, wd);
if (likely(watch))
if (likely(idr_find(&dev->idr, wd) == watch))
remove_watch(watch, dev);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment