summaryrefslogtreecommitdiffstats
path: root/mm/hwpoison-inject.c
diff options
context:
space:
mode:
authorWanpeng Li2015-09-09 00:03:18 +0200
committerLinus Torvalds2015-09-09 00:35:28 +0200
commitbe91748fa6ca6909853c3dc630d65e45084962d7 (patch)
tree478a90a3b91ecb5902777a75362521506b7f7eb2 /mm/hwpoison-inject.c
parentmm/hwpoison: introduce put_hwpoison_page to put refcount for memory error han... (diff)
downloadkernel-qcow2-linux-be91748fa6ca6909853c3dc630d65e45084962d7.tar.gz
kernel-qcow2-linux-be91748fa6ca6909853c3dc630d65e45084962d7.tar.xz
kernel-qcow2-linux-be91748fa6ca6909853c3dc630d65e45084962d7.zip
mm/hwpoison: fix refcount of THP head page in no-injection case
Hwpoison injection takes a refcount of target page and another refcount of head page of THP if the target page is the tail page of a THP. However, current code doesn't release the refcount of head page if the THP is not supported to be injected wrt hwpoison filter. Fix it by reducing the refcount of head page if the target page is the tail page of a THP and it is not supported to be injected. Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/hwpoison-inject.c')
-rw-r--r--mm/hwpoison-inject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c
index bf73ac17dad4..aeba0edd6e44 100644
--- a/mm/hwpoison-inject.c
+++ b/mm/hwpoison-inject.c
@@ -58,7 +58,7 @@ inject:
pr_info("Injecting memory failure at pfn %#lx\n", pfn);
return memory_failure(pfn, 18, MF_COUNT_INCREASED);
put_out:
- put_page(p);
+ put_hwpoison_page(p);
return 0;
}