All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Tinguely <mark.tinguely@oracle.com>
To: Dan Carpenter <dan.carpenter@linaro.org>, Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [External] : [PATCH] ocfs2: remove unnecessary NULL check in ocfs2_grab_folios()
Date: Tue, 19 Aug 2025 09:32:06 -0500	[thread overview]
Message-ID: <cf71e138-656d-4740-a5e9-43b4460147ca@oracle.com> (raw)
In-Reply-To: <aKRG39hyvDJcN2G7@stanley.mountain>

On 8/19/25 4:41 AM, Dan Carpenter wrote:
> Smatch complains that checking "folios" for NULL doesn't make sense
> because it has already been dereferenced at this point.  Really passing a
> NULL "folios" pointer to ocfs2_grab_folios() doesn't make sense, and
> fortunately none of the callers do that.  Delete the unnecessary NULL
> check.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>   fs/ocfs2/alloc.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
> index 821cb7874685..162711cc5b20 100644
> --- a/fs/ocfs2/alloc.c
> +++ b/fs/ocfs2/alloc.c
> @@ -6928,8 +6928,7 @@ static int ocfs2_grab_folios(struct inode *inode, loff_t start, loff_t end,
>   
>   out:
>   	if (ret != 0) {
> -		if (folios)
> -			ocfs2_unlock_and_free_folios(folios, numfolios);
> +		ocfs2_unlock_and_free_folios(folios, numfolios);
>   		numfolios = 0;
>   	}
>   

Reviewed-by: Mark Tinguely <mark.tinguely@oracle.com>

  reply	other threads:[~2025-08-19 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-19  9:41 [PATCH] ocfs2: remove unnecessary NULL check in ocfs2_grab_folios() Dan Carpenter
2025-08-19 14:32 ` Mark Tinguely [this message]
2025-08-20  5:34 ` Joseph Qi

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=cf71e138-656d-4740-a5e9-43b4460147ca@oracle.com \
    --to=mark.tinguely@oracle.com \
    --cc=dan.carpenter@linaro.org \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.