Commit 7c98f718 authored by Moritz Muehlenhoff's avatar Moritz Muehlenhoff Committed by Greg Kroah-Hartman
Browse files

Staging: wlan-ng: Remove unnecessary checks for NULL before calling kfree()

parent e469ee7f
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -1134,7 +1134,6 @@ static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev,
	if (nbss > 32)
		nbss = 32;

	if (hw->scanresults)
	kfree(hw->scanresults);

	hw->scanresults = kmalloc(sizeof(hfa384x_InfFrame_t), GFP_ATOMIC);
@@ -1966,9 +1965,7 @@ 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);
		return NULL;
	}
+2 −4
Original line number Diff line number Diff line
@@ -165,9 +165,7 @@ static int prism2sta_probe_usb(struct usb_interface *interface,
	goto done;

failed:
	if (wlandev)
	kfree(wlandev);
	if (hw)
	kfree(hw);
	wlandev = NULL;