Staging: wlan-ng: Remove unnecessary checks for NULL before calling kfree()
authorMoritz Muehlenhoff <jmm@debian.org>
Mon, 9 Feb 2009 18:33:42 +0000 (19:33 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Apr 2009 21:53:23 +0000 (14:53 -0700)
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/wlan-ng/prism2sta.c
drivers/staging/wlan-ng/prism2usb.c

index d720934be7937fcd37b97c56025d927072e090fe..c3ab31ef703af91edecaa932c5557bade1029523 100644 (file)
@@ -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;
        }
 
index 0bb4e78330604f10b761489329daca145e35cf74..252312e79581b13921919911dbdae10c6ec83014 100644 (file)
@@ -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: