diff options
| author | Mohammad Shahid <mdshahid03@gmail.com> | 2026-07-26 12:12:28 +0530 |
|---|---|---|
| committer | Viacheslav Dubeyko <slava@dubeyko.com> | 2026-07-27 18:07:37 -0700 |
| commit | c86df5cbba015c40985a49ce70217c370cd57fc6 (patch) | |
| tree | 7b3d6d6cc55b8f361655e8f8714a2a9369763fc7 | |
| parent | b4160f6325a84c0b04d32be32f928ca647b21b6e (diff) | |
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>
| -rw-r--r-- | fs/hfsplus/unicode_test.c | 3 |
1 files changed, 1 insertions, 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); } |
