[PATCH 24/24] staging: wlan-ng: Remove NULL check before kfree

From: Ilia Mirkin
Date: Sun Mar 13 2011 - 00:31:01 EST


This patch was generated by the following semantic patch:
// <smpl>
@@ 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: Ilia Mirkin <imirkin@xxxxxxxxxxxx>
---
drivers/staging/wlan-ng/hfa384x_usb.c | 6 ++----
drivers/staging/wlan-ng/prism2fw.c | 3 +--
2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index a6efc03..7843dfd 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -612,10 +612,8 @@ void hfa384x_destroy(hfa384x_t *hw)
hfa384x_drvr_stop(hw);
hw->state = HFA384x_STATE_PREINIT;

- if (hw->scanresults) {
- kfree(hw->scanresults);
- hw->scanresults = NULL;
- }
+ kfree(hw->scanresults);
+ hw->scanresults = NULL;

/* Now to clean out the auth queue */
while ((skb = skb_dequeue(&hw->authq)))
diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index fd5ddb2..729d03d 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -443,8 +443,7 @@ void free_chunks(struct imgchunk *fchunk, unsigned int *nfchunks)
{
int i;
for (i = 0; i < *nfchunks; i++) {
- if (fchunk[i].data != NULL)
- kfree(fchunk[i].data);
+ kfree(fchunk[i].data);
}
*nfchunks = 0;
memset(fchunk, 0, sizeof(*fchunk));
--
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/