Re: [PATCH] smb/client: remove redundant NULL check before kfree()

hehuiwen <[email protected]>
Newsgroups org.kernel.vger.linux-cifs
Message-ID <[email protected]>
Hi Namjae,

I copied the Fixes, Reported-by, and Closes tags from the kernel test
robot report when sending the patch.

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   3eb40771c00a8488fa6ed2cc1fe203477908bf38
> commit: 5693347de107a26f68d1f43b25ff2e348c7229a9 smb/client: use writable handle for FS_IOC_SETFLAGS compression
> date:   9 weeks ago
> config: powerpc-randconfig-r053-20260812 (https://download.01.org/0day-ci/archive/20260816/[email protected]/config)
> compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 12df34b8469b8095359de8c249cb1b2753fadeea)
> 
> 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
> | Fixes: 5693347de107 ("smb/client: use writable handle for FS_IOC_SETFLAGS compression")
> | Reported-by: kernel test robot <[email protected]>
> | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> 
> cocci warnings: (new ones prefixed by >>)
>>> fs/smb/client/ioctl.c:135:2-7: WARNING: NULL check before some freeing functions is not needed.

But chenxiaosong suggested that the Fixes tag may not be necessary 
because this is only a Coccinelle cleanup with no functional change. I
am not sure which convention is preferred here, so please feel free to
drop the Fixes tag when applying the patch.

Thanks,
Huiwen


在 2026/8/17 14:42, Namjae Jeon 写道:
> On Mon, Aug 17, 2026 at 12:40 AM Huiwen He <[email protected]> wrote:
>>
>> From: Huiwen He <[email protected]>
>>
>> kfree() accepts NULL pointers, so checking tmp_cfile before freeing it
>> is unnecessary and triggers a Coccinelle warning.
>>
>> Remove the redundant check. This does not change runtime behavior.
>>
>> Fixes: 5693347de107 ("smb/client: use writable handle for FS_IOC_SETFLAGS compression")
>> Reported-by: kernel test robot <[email protected]>
>> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
>> Signed-off-by: Huiwen He <[email protected]>
> Applied it to #for-next.
> Thanks!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.