Minor page waitqueue cleanups
[sfrench/cifs-2.6.git] / kernel / sched / wait.c
index 17f11c6b0a9f7a87010c17d3b775739d7e0d93a1..d6afed6d0752c6cdd09a094d61d0bcae9184f865 100644 (file)
@@ -70,9 +70,10 @@ static void __wake_up_common(struct wait_queue_head *wq_head, unsigned int mode,
 
        list_for_each_entry_safe(curr, next, &wq_head->head, entry) {
                unsigned flags = curr->flags;
-
-               if (curr->func(curr, mode, wake_flags, key) &&
-                               (flags & WQ_FLAG_EXCLUSIVE) && !--nr_exclusive)
+               int ret = curr->func(curr, mode, wake_flags, key);
+               if (ret < 0)
+                       break;
+               if (ret && (flags & WQ_FLAG_EXCLUSIVE) && !--nr_exclusive)
                        break;
        }
 }