mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
e469ee7f56
commit
7c98f71878
|
@ -1134,7 +1134,6 @@ static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev,
|
||||||
if (nbss > 32)
|
if (nbss > 32)
|
||||||
nbss = 32;
|
nbss = 32;
|
||||||
|
|
||||||
if (hw->scanresults)
|
|
||||||
kfree(hw->scanresults);
|
kfree(hw->scanresults);
|
||||||
|
|
||||||
hw->scanresults = kmalloc(sizeof(hfa384x_InfFrame_t), GFP_ATOMIC);
|
hw->scanresults = kmalloc(sizeof(hfa384x_InfFrame_t), GFP_ATOMIC);
|
||||||
|
@ -1966,9 +1965,7 @@ static wlandevice_t *create_wlan(void)
|
||||||
|
|
||||||
if (!wlandev || !hw) {
|
if (!wlandev || !hw) {
|
||||||
printk(KERN_ERR "%s: Memory allocation failure.\n", dev_info);
|
printk(KERN_ERR "%s: Memory allocation failure.\n", dev_info);
|
||||||
if (wlandev)
|
|
||||||
kfree(wlandev);
|
kfree(wlandev);
|
||||||
if (hw)
|
|
||||||
kfree(hw);
|
kfree(hw);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,9 +165,7 @@ static int prism2sta_probe_usb(struct usb_interface *interface,
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
if (wlandev)
|
|
||||||
kfree(wlandev);
|
kfree(wlandev);
|
||||||
if (hw)
|
|
||||||
kfree(hw);
|
kfree(hw);
|
||||||
wlandev = NULL;
|
wlandev = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue