Skip to content

Commit

Permalink
r8152: fix setting RTL8152_UNPLUG
Browse files Browse the repository at this point in the history
The flag of RTL8152_UNPLUG should only be set when the device is
unplugged, not each time the rtl8152_disconnect() is called.
Otherwise, the device wouldn't be stopped normally.

Signed-off-by: Hayes Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
hayesorz authored and davem330 committed Sep 30, 2014
1 parent 37b9a26 commit f561de3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -3576,7 +3576,11 @@ static void rtl8152_disconnect(struct usb_interface *intf)

usb_set_intfdata(intf, NULL);
if (tp) {
set_bit(RTL8152_UNPLUG, &tp->flags);
struct usb_device *udev = tp->udev;

if (udev->state == USB_STATE_NOTATTACHED)
set_bit(RTL8152_UNPLUG, &tp->flags);

tasklet_kill(&tp->tl);
unregister_netdev(tp->netdev);
tp->rtl_ops.unload(tp);
Expand Down

0 comments on commit f561de3

Please sign in to comment.