[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <558EB4DE.3080406@users.sourceforge.net>
Date: Sat, 27 Jun 2015 16:36:14 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: Chris Park <chris.park@...el.com>, Dean Lee <dean.lee@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Johnny Kim <johnny.kim@...el.com>,
Rachel Kim <rachel.kim@...el.com>,
linux-wireless@...r.kernel.org, devel@...verdev.osuosl.org
CC: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 1/2] staging: wilc1000: Delete unnecessary checks before two
function calls
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 27 Jun 2015 15:56:57 +0200
The functions kfree() and release_firmware() test whether their argument
is NULL and then return immediately.
Thus the test around the calls is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/staging/wilc1000/linux_wlan.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index b352c50..2aa8d9b 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2421,11 +2421,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
}
done:
-
- if (buff != NULL) {
- kfree(buff);
- }
-
+ kfree(buff);
return s32Error;
}
@@ -2707,8 +2703,7 @@ static void __exit exit_wilc_driver(void)
}
}
-
- if ((g_linux_wlan != NULL) && g_linux_wlan->wilc_firmware != NULL) {
+ if (g_linux_wlan) {
release_firmware(g_linux_wlan->wilc_firmware);
g_linux_wlan->wilc_firmware = NULL;
}
--
2.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists