Skip to content

Commit

Permalink
can: ems_usb: Removed double netif_device_detach
Browse files Browse the repository at this point in the history
netif_device_attched is called twice when ems_usb_start fails with -ENODEV

Signed-off-by: Sebastian Haas <dev@sebastianhaas.info>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Sebastian Haas authored and Marc Kleine-Budde committed Feb 2, 2012
1 parent 44b0052 commit d0a71a7
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions drivers/net/can/usb/ems_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,6 @@ static int ems_usb_start(struct ems_usb *dev)

err = usb_submit_urb(urb, GFP_KERNEL);
if (err) {
if (err == -ENODEV)
netif_device_detach(dev->netdev);

usb_unanchor_urb(urb);
usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf,
urb->transfer_dma);
Expand Down Expand Up @@ -659,9 +656,6 @@ static int ems_usb_start(struct ems_usb *dev)

err = usb_submit_urb(dev->intr_urb, GFP_KERNEL);
if (err) {
if (err == -ENODEV)
netif_device_detach(dev->netdev);

dev_warn(netdev->dev.parent, "intr URB submit failed: %d\n",
err);

Expand Down Expand Up @@ -692,9 +686,6 @@ static int ems_usb_start(struct ems_usb *dev)
return 0;

failed:
if (err == -ENODEV)
netif_device_detach(dev->netdev);

dev_warn(netdev->dev.parent, "couldn't submit control: %d\n", err);

return err;
Expand Down

0 comments on commit d0a71a7

Please sign in to comment.