summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authortom.leiming@gmail.com <tom.leiming@gmail.com>2012-04-30 00:51:03 +0200
committerDavid S. Miller <davem@davemloft.net>2012-05-03 02:13:04 +0200
commita4723848d05dd31d298c551fb77ad28481309999 (patch)
tree8d3e6a96e1e609700aa10a26148900172362a7c0 /drivers/net
parentusbnet: fix leak of transfer buffer of dev->interrupt (diff)
downloadlinux-a4723848d05dd31d298c551fb77ad28481309999.tar.xz
linux-a4723848d05dd31d298c551fb77ad28481309999.zip
usbnet: fix failure handling in usbnet_probe
If register_netdev returns failure, the dev->interrupt and its transfer buffer should be released, so just fix it. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/usb/usbnet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index ca6fd80c2b40..2d927fb4adf4 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1444,7 +1444,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
status = register_netdev (net);
if (status)
- goto out3;
+ goto out4;
netif_info(dev, probe, dev->net,
"register '%s' at usb-%s-%s, %s, %pM\n",
udev->dev.driver->name,
@@ -1462,6 +1462,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
return 0;
+out4:
+ usb_free_urb(dev->interrupt);
out3:
if (info->unbind)
info->unbind (dev, udev);