linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Everest K.C." <everestkc@everestkc.com.np>
To: akpm@linux-foundation.org
Cc: "Everest K.C." <everestkc@everestkc.com.np>,
	skhan@linuxfoundation.org, linux-mm@kvack.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] mm/execmem: Remove logically deadcode in execmem.c
Date: Thu, 10 Oct 2024 12:10:58 -0600	[thread overview]
Message-ID: <20241010181102.5522-1-everestkc@everestkc.com.np> (raw)

NULL check of variable `area` within the `mas_for_each` loop is
unnecessary, as the varialbe `area` can never be NULL. So, the
`continue` statement inside the if block is never reached.

Remove the if block that performs the NULL check.

This was reported by Coverity Scan:
https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600362

Fixes: d44c3485820e ("execmem: add support for cache of large ROX pages")
Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
---
 mm/execmem.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mm/execmem.c b/mm/execmem.c
index 9c6ff9687860..97706d8ed720 100644
--- a/mm/execmem.c
+++ b/mm/execmem.c
@@ -75,9 +75,6 @@ static void execmem_cache_clean(struct work_struct *work)
 	mas_for_each(&mas, area, ULONG_MAX) {
 		size_t size;
 
-		if (!area)
-			continue;
-
 		size = mas_range_len(&mas);
 
 		if (IS_ALIGNED(size, PMD_SIZE) &&
-- 
2.43.0



             reply	other threads:[~2024-10-10 18:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 18:10 Everest K.C. [this message]
2024-10-10 21:51 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241010181102.5522-1-everestkc@everestkc.com.np \
    --to=everestkc@everestkc.com.np \
    --cc=akpm@linux-foundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox