NFS: remove the redundant check when kfree an object in nfs_netns_client_release
Subsystems (3)
PATCH 1/1 NFS: remove the redundant check when kfree an object in nfs_netns_client_release
kfree has taken the null check in account. hence it is unnecessary to add the null check before kfree the object. Just remove it.
--- fs/nfs/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfs/sysfs.c +1 -2
@@ -121,8 +121,7 @@ static void nfs_netns_client_release(struct kobject *kobj) struct nfs_netns_client, kobject); -if (c->identifier) -kfree (c->identifier); +kfree (c->identifier);kfree (c); }
Signature · 1 line
1.7.12.4
Quoted 1 line
kfree has taken the null check in account.
I suggest to take another look at a similar patch.
NFS: fix ifnullfree.cocci warnings
https://lkml.org/lkml/2019/7/7/73
https://lore.kernel.org/patchwork/patch/1098005/
https://lore.kernel.org/r/alpine.DEB.2.21.1907071844310.2521@hadrien/
Regards,
Markus
Quoted 2 lines · Markus Elfring
Quoted 1 line
kfree has taken the null check in account.
I suggest to take another look at a similar patch.
How to fast find out the similar patch. Search the key word doesn't work well.
Thanks,
zhong jiang
Quoted 10 lines
NFS: fix
ifnullfree.cocciwarnings
https://lkml.org/lkml/2019/7/7/73
https://lore.kernel.org/patchwork/patch/1098005/
https://lore.kernel.org/r/alpine.DEB.2.21.1907071844310.2521@hadrien/Regards,
Markus.
Re: NFS: Checking the handling of patch variations
Quoted 2 lines
Quoted 1 line
I suggest to take another look at a similar patch.
How to fast find out the similar patch. Search the key word doesn't work well.
This is a recurring development challenge, isn't it?
The occurrence of related update suggestions can occasionally become more interesting.
Regards,
Markus