From: Shraddha Barke Date: Mon, 10 Aug 2015 08:00:33 +0000 (+0530) Subject: Staging: wilc1000: Remove null check before kfree X-Git-Tag: v4.3-rc1~158^2~72 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=642ac6c0dceb6292065d08925e6ffd6ef1fbc7e1;p=karo-tx-linux.git 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. // @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // smpl> Signed-off-by: Shraddha Barke Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 4b5e5b264e85..e295e4ccad11 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; }