mm, page_alloc: fix core hung in free_pcppages_bulk()
[sfrench/cifs-2.6.git] / mm / page_alloc.c
index f4b3b91bbe7f1051c625488ff0176dee6df466d8..fab5e97dc9ca5b10b09984fdde6c90a6bc4daff0 100644 (file)
@@ -1302,6 +1302,11 @@ static void free_pcppages_bulk(struct zone *zone, int count,
        struct page *page, *tmp;
        LIST_HEAD(head);
 
+       /*
+        * Ensure proper count is passed which otherwise would stuck in the
+        * below while (list_empty(list)) loop.
+        */
+       count = min(pcp->count, count);
        while (count) {
                struct list_head *list;