fs/hfsplus/unicode_test.c:43:2-7: WARNING: NULL check before some freeing functions is not needed.
From: kernel test robot
Date: Fri Jan 02 2026 - 10:18:20 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b69053dd3ffbc0d2dedbbc86182cdef6f641fe1b
commit: 6f84ceb98538523f49d544aa7c671c87cc23d1b1 hfsplus: introduce KUnit tests for HFS+ string operations
date: 6 weeks ago
config: arm-randconfig-r051-20251231 (https://download.01.org/0day-ci/archive/20260102/202601022306.Dll2Dylo-lkp@xxxxxxxxx/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 86b9f90b9574b3a7d15d28a91f6316459dcfa046)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601022306.Dll2Dylo-lkp@xxxxxxxxx/
cocci warnings: (new ones prefixed by >>)
>> fs/hfsplus/unicode_test.c:43:2-7: WARNING: NULL check before some freeing functions is not needed.
vim +43 fs/hfsplus/unicode_test.c
39
40 static void free_mock_str_env(struct test_mock_string_env *env)
41 {
42 if (env->buf)
> 43 kfree(env->buf);
44 kfree(env);
45 }
46
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki