Commit 4779cb31c0ee3b355116745edca3f3e5fe865553
1 parent
e43c3afb36
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
mm/memory.c
... | ... | @@ -2539,7 +2539,7 @@ |
2539 | 2539 | } else if (PageHWPoison(page)) { |
2540 | 2540 | ret = VM_FAULT_HWPOISON; |
2541 | 2541 | delayacct_clear_flag(DELAYACCT_PF_SWAPIN); |
2542 | - goto out; | |
2542 | + goto out_release; | |
2543 | 2543 | } |
2544 | 2544 | |
2545 | 2545 | lock_page(page); |
... | ... | @@ -2611,6 +2611,7 @@ |
2611 | 2611 | pte_unmap_unlock(page_table, ptl); |
2612 | 2612 | out_page: |
2613 | 2613 | unlock_page(page); |
2614 | +out_release: | |
2614 | 2615 | page_cache_release(page); |
2615 | 2616 | return ret; |
2616 | 2617 | } |