diff options
author | Shraddha Barke <shraddha.6596@gmail.com> | 2015-08-10 08:00:33 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-15 01:44:45 (GMT) |
commit | 642ac6c0dceb6292065d08925e6ffd6ef1fbc7e1 (patch) | |
tree | cbe4edf39c2dce155377226d1144c6aaeba53a13 /drivers/staging/wilc1000 | |
parent | 772a6e1fff9a8c942e982598632cfc41451e2e9a (diff) | |
download | linux-642ac6c0dceb6292065d08925e6ffd6ef1fbc7e1.tar.xz |
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>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/linux_wlan.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 4b5e5b2..e295e4c 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -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; } |