smb: client: remove redundant NULL check before kfree()
Subsystems (2)
PATCH 1/1 smb: client: remove redundant NULL check before kfree()
From: Mohammad Shahid <[email protected]>
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 <[email protected]>
--- fs/smb/client/ioctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/smb/client/ioctl.c +1 -2
@@ -133,8 +133,7 @@ static int cifs_set_compression_by_path(unsigned int xid, struct file *filep, close: server->ops->close (xid, tcon, &fid); -if (tmp_cfile) -kfree (tmp_cfile); +kfree (tmp_cfile);cifs_free_open_info (&data); out:free_dentry_path (page);
Signature · 1 line
2.43.0
Hi,
Gentle ping on this patch.
Could you please take a look when time permits?
Thanks!
Mohammad Shahid
The patch is correct but it doesn't improve clarity and doesn't fix a bug.
Any other opinions on whether merging a patch like this?
Quoted 12 lines · On Fri, Jul 24, 2026 at 7:34 AM <[email protected]> wrote:
Hi,
Gentle ping on this patch.
Could you please take a look when time permits?
Thanks!
Mohammad Shahid
Signature · 3 lines
Thanks, Steve
Quoted 5 lines · [email protected] writes:
From: Mohammad Shahid <[email protected]>
kfree()safely handles NULL pointers, so the explicit NULL check before callingkfree()is unnecessary.
...
Applied.