提交 7c98f718 编写于 作者: M Moritz Muehlenhoff 提交者: Greg Kroah-Hartman

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

Signed-off-by: NMoritz Muehlenhoff <jmm@debian.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 e469ee7f
...@@ -1134,8 +1134,7 @@ static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev, ...@@ -1134,8 +1134,7 @@ 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);
memcpy(hw->scanresults, inf, sizeof(hfa384x_InfFrame_t)); memcpy(hw->scanresults, inf, sizeof(hfa384x_InfFrame_t));
...@@ -1966,10 +1965,8 @@ static wlandevice_t *create_wlan(void) ...@@ -1966,10 +1965,8 @@ 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); kfree(hw);
if (hw)
kfree(hw);
return NULL; return NULL;
} }
......
...@@ -165,10 +165,8 @@ static int prism2sta_probe_usb(struct usb_interface *interface, ...@@ -165,10 +165,8 @@ static int prism2sta_probe_usb(struct usb_interface *interface,
goto done; goto done;
failed: failed:
if (wlandev) kfree(wlandev);
kfree(wlandev); kfree(hw);
if (hw)
kfree(hw);
wlandev = NULL; wlandev = NULL;
done: done:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册