Skip to content

Commit

Permalink
staging: wlan-ng: Remove NULL check before kfree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ilia Mirkin authored and Greg Kroah-Hartman committed Mar 14, 2011
1 parent 4d527a7 commit a6f9c48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions drivers/staging/wlan-ng/hfa384x_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/wlan-ng/prism2fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit a6f9c48

Please sign in to comment.