From: "Darrick J. Wong" <djwong@kernel.org>
To: Chen Ni <nichen@iscas.ac.cn>
Cc: cem@kernel.org, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xfs: remove unnecessary NULL check before kvfree()
Date: Tue, 11 Mar 2025 09:01:31 -0700 [thread overview]
Message-ID: <20250311160131.GW2803749@frogsfrogsfrogs> (raw)
In-Reply-To: <20250311071114.1037911-1-nichen@iscas.ac.cn>
On Tue, Mar 11, 2025 at 03:11:14PM +0800, Chen Ni wrote:
> Remove unnecessary NULL check before kvfree() reported by
> Coccinelle/coccicheck and the semantic patch at
> scripts/coccinelle/free/ifnullfree.cocci.
>
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Probably fine, though the line numbers have moved around a lot in
for-next...
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_rtalloc.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
> index 57bef567e011..9688e8ca6915 100644
> --- a/fs/xfs/xfs_rtalloc.c
> +++ b/fs/xfs/xfs_rtalloc.c
> @@ -1144,8 +1144,7 @@ xfs_growfs_rtg(
> goto out_error;
> }
>
> - if (old_rsum_cache)
> - kvfree(old_rsum_cache);
> + kvfree(old_rsum_cache);
> xfs_rtgroup_rele(rtg);
> return 0;
>
> --
> 2.25.1
>
>
prev parent reply other threads:[~2025-03-11 16:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 7:11 Chen Ni
2025-03-11 16:01 ` Darrick J. Wong [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=20250311160131.GW2803749@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=nichen@iscas.ac.cn \
/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®