diff options
author | Moritz Muehlenhoff <jmm@debian.org> | 2009-02-09 18:33:42 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 21:53:23 (GMT) |
commit | 7c98f718786c3c6d03ee377b62838fff3cc8f573 (patch) | |
tree | 5aa472ac92632fa9ba93d8a41b633564b765a5a9 /drivers/staging/wlan-ng | |
parent | e469ee7f561657e260690ae202a32adb60e26730 (diff) | |
download | linux-fsl-qoriq-7c98f718786c3c6d03ee377b62838fff3cc8f573.tar.xz |
Staging: wlan-ng: Remove unnecessary checks for NULL before calling kfree()
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/prism2sta.c | 9 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2usb.c | 6 |
2 files changed, 5 insertions, 10 deletions
diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index d720934..c3ab31e 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -1134,8 +1134,7 @@ static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev, if (nbss > 32) nbss = 32; - if (hw->scanresults) - kfree(hw->scanresults); + kfree(hw->scanresults); hw->scanresults = kmalloc(sizeof(hfa384x_InfFrame_t), GFP_ATOMIC); memcpy(hw->scanresults, inf, sizeof(hfa384x_InfFrame_t)); @@ -1966,10 +1965,8 @@ static wlandevice_t *create_wlan(void) if (!wlandev || !hw) { printk(KERN_ERR "%s: Memory allocation failure.\n", dev_info); - if (wlandev) - kfree(wlandev); - if (hw) - kfree(hw); + kfree(wlandev); + kfree(hw); return NULL; } diff --git a/drivers/staging/wlan-ng/prism2usb.c b/drivers/staging/wlan-ng/prism2usb.c index 0bb4e78..252312e 100644 --- a/drivers/staging/wlan-ng/prism2usb.c +++ b/drivers/staging/wlan-ng/prism2usb.c @@ -165,10 +165,8 @@ static int prism2sta_probe_usb(struct usb_interface *interface, goto done; failed: - if (wlandev) - kfree(wlandev); - if (hw) - kfree(hw); + kfree(wlandev); + kfree(hw); wlandev = NULL; done: |