diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5818f5f2fe880e8cfc3a3c0f3d6c8da241dc82eb..e394ae5ba2a7154aa04b3e04e420876460d1bee0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1116,6 +1116,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;