diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b5c7b63a3102..5717ee66c8b3 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1115,6 +1115,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;