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