aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/swap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/swap.c b/mm/swap.c
index 33f5292fe13..e0eeef94088 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -131,8 +131,12 @@ static void put_compound_page(struct page *page)
atomic_dec(&page->_count);
VM_BUG_ON(atomic_read(&page_head->_count) <= 0);
compound_unlock_irqrestore(page_head, flags);
- if (put_page_testzero(page_head))
- __put_compound_page(page_head);
+ if (put_page_testzero(page_head)) {
+ if (PageHead(page_head))
+ __put_compound_page(page_head);
+ else
+ __put_single_page(page_head);
+ }
} else {
/* page_head is a dangling pointer */
VM_BUG_ON(PageTail(page));