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: <cd28052e89166d4ab90e360cce3421748076a0fc.1641465458.git.baolin.wang@linux.alibaba.com>
Date:   Thu,  6 Jan 2022 18:40:11 +0800
From:   Baolin Wang <baolin.wang@...ux.alibaba.com>
To:     sj@...nel.org, akpm@...ux-foundation.org
Cc:     dan.carpenter@...cle.com, baolin.wang@...ux.alibaba.com,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [PATCH] mm/damon: Remove redundant page validation

It will never get a NULL page by pte_page(), thus remove the redundant
page validation to fix below Smatch static checker warning.

mm/damon/vaddr.c:405 damon_hugetlb_mkold()
warn: 'page' can't be NULL.

Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
---
 mm/damon/vaddr.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index 89b6468d..8a52e00 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -402,9 +402,6 @@ static void damon_hugetlb_mkold(pte_t *pte, struct mm_struct *mm,
 	pte_t entry = huge_ptep_get(pte);
 	struct page *page = pte_page(entry);
 
-	if (!page)
-		return;
-
 	get_page(page);
 
 	if (pte_young(entry)) {
@@ -564,9 +561,6 @@ static int damon_young_hugetlb_entry(pte_t *pte, unsigned long hmask,
 		goto out;
 
 	page = pte_page(entry);
-	if (!page)
-		goto out;
-
 	get_page(page);
 
 	if (pte_young(entry) || !page_is_idle(page) ||
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ