fsnotify: allow fsnotify_{peek,remove}_first_event with empty queue
[linux-2.6-microblaze.git] / fs / notify / inotify / inotify_user.c
index c71be4f..a6c95bd 100644 (file)
@@ -146,10 +146,9 @@ static struct fsnotify_event *get_one_event(struct fsnotify_group *group,
        size_t event_size = sizeof(struct inotify_event);
        struct fsnotify_event *event;
 
-       if (fsnotify_notify_queue_is_empty(group))
-               return NULL;
-
        event = fsnotify_peek_first_event(group);
+       if (!event)
+               return NULL;
 
        pr_debug("%s: group=%p event=%p\n", __func__, group, event);