mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 14:33:24 -04:00
fs: hfsplus: remove redundant NULL check before kfree()
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> Link: https://lore.kernel.org/r/20260726064228.248199-1-mdshahid03@gmail.com Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com> Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
This commit is contained in:
committed by
Viacheslav Dubeyko
parent
b4160f6325
commit
c86df5cbba
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user