staging: wlan-ng: Remove NULL check before kfree
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 13 Mar 2011 05:29:17 +0000 (00:29 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Mar 2011 18:57:38 +0000 (11:57 -0700)
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@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/wlan-ng/hfa384x_usb.c
drivers/staging/wlan-ng/prism2fw.c

index a6efc033fe10b41895768509a2b5603bae104c98..7843dfdaa3cf69cb348d006f0382cbc4409da42c 100644 (file)
@@ -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)))
index fd5ddb29436c381d8d8deccc26fecb304996c5e1..729d03d28d75169a66c1b5d1e13ed5ccb785a645 100644 (file)
@@ -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));