summaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-09-27 02:08:03 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-27 02:08:03 -0400
commitf875691640cd3fa67f7ad1d3130ff9fa7fdca042 (patch)
treeb33a56d240b32ad2d68a9ed88bda57474d0e1d52 /drivers/net/can
parent207070f5221e2a901d56a49df9cde47d9b716cd7 (diff)
parentf37d6e701f2a3a04e66690397340a6417f6e053f (diff)
downloadblackbird-op-linux-f875691640cd3fa67f7ad1d3130ff9fa7fdca042.tar.gz
blackbird-op-linux-f875691640cd3fa67f7ad1d3130ff9fa7fdca042.zip
Merge branch 'fixes-for-3.12' of git://gitorious.org/linux-can/linux-can
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/usb/peak_usb/pcan_usb_core.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index a0f647f92bf5..0b7a4c3b01a2 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -463,7 +463,7 @@ static int peak_usb_start(struct peak_usb_device *dev)
if (i < PCAN_USB_MAX_TX_URBS) {
if (i == 0) {
netdev_err(netdev, "couldn't setup any tx URB\n");
- return err;
+ goto err_tx;
}
netdev_warn(netdev, "tx performance may be slow\n");
@@ -472,7 +472,7 @@ static int peak_usb_start(struct peak_usb_device *dev)
if (dev->adapter->dev_start) {
err = dev->adapter->dev_start(dev);
if (err)
- goto failed;
+ goto err_adapter;
}
dev->state |= PCAN_USB_STATE_STARTED;
@@ -481,19 +481,26 @@ static int peak_usb_start(struct peak_usb_device *dev)
if (dev->adapter->dev_set_bus) {
err = dev->adapter->dev_set_bus(dev, 1);
if (err)
- goto failed;
+ goto err_adapter;
}
dev->can.state = CAN_STATE_ERROR_ACTIVE;
return 0;
-failed:
+err_adapter:
if (err == -ENODEV)
netif_device_detach(dev->netdev);
netdev_warn(netdev, "couldn't submit control: %d\n", err);
+ for (i = 0; i < PCAN_USB_MAX_TX_URBS; i++) {
+ usb_free_urb(dev->tx_contexts[i].urb);
+ dev->tx_contexts[i].urb = NULL;
+ }
+err_tx:
+ usb_kill_anchored_urbs(&dev->rx_submitted);
+
return err;
}
OpenPOWER on IntegriCloud