lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150729155246.2fed1b96@hp>
Date:	Wed, 29 Jul 2015 15:52:46 +0800
From:	Wang Xiaoqiang <wangxq10@....edu.cn>
To:	n-horiguchi@...jp.nec.com, n-horiguchi@...jp.nec.com,
	n-horiguchi@...jp.nec.com, n-horiguchi@...jp.nec.com,
	n-horiguchi@...jp.nec.com, n-horiguchi@...jp.nec.com,
	linux-kernel@...r.kernel.org
Cc:	n-horiguchi@...jp.nec.com, n-horiguchi@...jp.nec.com
Subject: [PATCH] memory_failure: remove redundant check for the PG_HWPoison
 flag of 'hpage'

Hi,

I find a little problem in the memory_failure function in
mm/memory-failure.c . Please check it.

memory_failure: remove redundant check for the PG_HWPoison flag of
`hpage'.

Since we have check the PG_HWPoison flag by `PageHWPoison' before,
so the later check by `TestSetPageHWPoison' must return true, there
is no need to check again!

Signed-off-by: Wang Xiaoqiang <wangxq10@....edu.cn>
---
 mm/memory-failure.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 1cf7f29..7794fd8 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1115,7 +1115,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
 			lock_page(hpage);
 			if (PageHWPoison(hpage)) {
 				if ((hwpoison_filter(p) && TestClearPageHWPoison(p))
-				    || (p != hpage && TestSetPageHWPoison(hpage))) {
+				    || p != hpage) {
 					atomic_long_sub(nr_pages, &num_poisoned_pages);
 					unlock_page(hpage);
 					return 0;
-- 
1.7.10.4



--
thx!
Wang Xiaoqiang

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ