diff options
author | tom.leiming@gmail.com <tom.leiming@gmail.com> | 2012-04-29 18:51:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-02 20:13:04 -0400 |
commit | a4723848d05dd31d298c551fb77ad28481309999 (patch) | |
tree | 8d3e6a96e1e609700aa10a26148900172362a7c0 | |
parent | 720f3d7cb19eb27f85f72836c8f8004ccb257f39 (diff) |
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>
-rw-r--r-- | drivers/net/usb/usbnet.c | 4 |
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) | |||
1444 | 1444 | ||
1445 | status = register_netdev (net); | 1445 | status = register_netdev (net); |
1446 | if (status) | 1446 | if (status) |
1447 | goto out3; | 1447 | goto out4; |
1448 | netif_info(dev, probe, dev->net, | 1448 | netif_info(dev, probe, dev->net, |
1449 | "register '%s' at usb-%s-%s, %s, %pM\n", | 1449 | "register '%s' at usb-%s-%s, %s, %pM\n", |
1450 | udev->dev.driver->name, | 1450 | udev->dev.driver->name, |
@@ -1462,6 +1462,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1462 | 1462 | ||
1463 | return 0; | 1463 | return 0; |
1464 | 1464 | ||
1465 | out4: | ||
1466 | usb_free_urb(dev->interrupt); | ||
1465 | out3: | 1467 | out3: |
1466 | if (info->unbind) | 1468 | if (info->unbind) |
1467 | info->unbind (dev, udev); | 1469 | info->unbind (dev, udev); |