From: Ilia Mirkin Date: Sun, 13 Mar 2011 05:29:17 +0000 (-0500) Subject: staging: wlan-ng: Remove NULL check before kfree X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6f9c48fdd566e09d437e104c5b5963133db1be4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: wlan-ng: Remove NULL check before kfree This patch was generated by the following semantic patch: // @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // Signed-off-by: Ilia Mirkin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index a6efc033fe10..7843dfdaa3cf 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 fd5ddb29436c..729d03d28d75 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));