mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 13:29:17 -04:00
Staging: wilc1000: Remove null check before kfree
kfree on NULL pointer is a no-op.
This patch uses the following semantic patch to find such an instance
where NULL check is present before kfree.
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>smpl>
Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
772a6e1fff
commit
642ac6c0dc
@@ -2338,8 +2338,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
|
||||
|
||||
done:
|
||||
|
||||
if (buff != NULL)
|
||||
kfree(buff);
|
||||
kfree(buff);
|
||||
|
||||
return s32Error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user