mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: "Everest K.C." <everestkc@everestkc.com.np>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH][next] mm/execmem: Remove logically deadcode in execmem.c
Date: Thu, 10 Oct 2024 15:51:16 -0600	[thread overview]
Message-ID: <2d048360-64b8-4af8-a5a5-3b69c5d3247d@linuxfoundation.org> (raw)
In-Reply-To: <20241010181102.5522-1-everestkc@everestkc.com.np>

On 10/10/24 12:10, Everest K.C. wrote:
> 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;
> -

This more of a question than comment:
mas_for_each() says:
Note: may return the zero entry.

Does that mean mas_range_len() can be zero? Does that
need to be handled?


>   		size = mas_range_len(&mas);
>   
>   		if (IS_ALIGNED(size, PMD_SIZE) &&


thanks,
-- Shuah

      reply	other threads:[~2024-10-10 21:51 UTC|newest]

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

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=2d048360-64b8-4af8-a5a5-3b69c5d3247d@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=everestkc@everestkc.com.np \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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

all inboxes | Powered by JetHome®