From: Viacheslav Dubeyko <slava@dubeyko.com>
To: mdshahid03@gmail.com,
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
Yangtao Li <frank.li@vivo.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: hfsplus: remove redundant NULL check before kfree()
Date: Mon, 27 Jul 2026 17:59:32 -0700 [thread overview]
Message-ID: <324da71d47e8b7b501ba0b90819cf00b9a2ac01c.camel@dubeyko.com> (raw)
In-Reply-To: <20260726064228.248199-1-mdshahid03@gmail.com>
On Sun, 2026-07-26 at 12:12 +0530, mdshahid03@gmail.com wrote:
> From: Mohammad Shahid <mdshahid03@gmail.com>
>
> kfree() safely handles NULL pointers, so the explicit NULL check
> before calling kfree() is unnecessary.
>
> This issue was reported by ifnullfree.cocci.
>
> Signed-off-by: Mohammad Shahid <mdshahid03@gmail.com>
> ---
> fs/hfsplus/unicode_test.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/hfsplus/unicode_test.c b/fs/hfsplus/unicode_test.c
> index 83737c9bafa0..7f6b2a3c69d9 100644
> --- a/fs/hfsplus/unicode_test.c
> +++ b/fs/hfsplus/unicode_test.c
> @@ -39,8 +39,7 @@ static struct test_mock_string_env
> *setup_mock_str_env(u32 buf_size)
>
> static void free_mock_str_env(struct test_mock_string_env *env)
> {
> - if (env->buf)
> - kfree(env->buf);
> + kfree(env->buf);
> kfree(env);
> }
>
Makes sense.
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Thanks,
Slava.
next prev parent reply other threads:[~2026-07-28 0:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 10:22 mdshahid03
2026-07-24 12:40 ` mdshahid03
2026-07-24 18:17 ` Viacheslav Dubeyko
2026-07-26 6:36 ` mdshahid03
2026-07-26 6:42 ` mdshahid03
2026-07-28 0:59 ` Viacheslav Dubeyko [this message]
2026-07-28 1:57 ` Viacheslav Dubeyko
[not found] ` <CACRLeC5agyqVnvjdziV5C_Z+y6NPvXg1Nyv2g_mmK2D1QbsfYQ@mail.gmail.com>
2026-07-24 18:09 ` Viacheslav Dubeyko
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=324da71d47e8b7b501ba0b90819cf00b9a2ac01c.camel@dubeyko.com \
--to=slava@dubeyko.com \
--cc=frank.li@vivo.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdshahid03@gmail.com \
/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®