aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2009-10-13 19:51:41 -0400
committerAndi Kleen <ak@linux.intel.com>2009-10-19 01:29:20 -0400
commit4779cb31c0ee3b355116745edca3f3e5fe865553 (patch)
tree7409cb0762ca55afe11aa981db4624d3496ed6fb /mm/memory.c
parente43c3afb367112a5b357f9adfac7817255129c88 (diff)
HWPOISON: Fix page count leak in hwpoison late kill in do_swap_page
When returning due to a poisoned page drop the page count. It wasn't a fatal problem because noone cares about the page count on a poisoned page (except when it wraps), but it's cleaner to fix it. Pointed out by Linus. Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 7e91b5f9f690..7a3b0ad5594a 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2539,7 +2539,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
2539 } else if (PageHWPoison(page)) { 2539 } else if (PageHWPoison(page)) {
2540 ret = VM_FAULT_HWPOISON; 2540 ret = VM_FAULT_HWPOISON;
2541 delayacct_clear_flag(DELAYACCT_PF_SWAPIN); 2541 delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
2542 goto out; 2542 goto out_release;
2543 } 2543 }
2544 2544
2545 lock_page(page); 2545 lock_page(page);
@@ -2611,6 +2611,7 @@ out_nomap:
2611 pte_unmap_unlock(page_table, ptl); 2611 pte_unmap_unlock(page_table, ptl);
2612out_page: 2612out_page:
2613 unlock_page(page); 2613 unlock_page(page);
2614out_release:
2614 page_cache_release(page); 2615 page_cache_release(page);
2615 return ret; 2616 return ret;
2616} 2617}