Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5eeb3132 authored by Ming Lei's avatar Ming Lei Committed by David S. Miller
Browse files

usbnet: decrease suspend count if returning -EBUSY for runtime suspend



This patch decreases dev->suspend_count in the -EBUSY failure path
of usbnet_suspend. Without the change, the later runtime suspend
will do nothing except for increasing dev->suspend_count.

Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
Acked-by: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fb13c47b
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1515,6 +1515,7 @@ int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
		spin_lock_irq(&dev->txq.lock);
		spin_lock_irq(&dev->txq.lock);
		/* don't autosuspend while transmitting */
		/* don't autosuspend while transmitting */
		if (dev->txq.qlen && PMSG_IS_AUTO(message)) {
		if (dev->txq.qlen && PMSG_IS_AUTO(message)) {
			dev->suspend_count--;
			spin_unlock_irq(&dev->txq.lock);
			spin_unlock_irq(&dev->txq.lock);
			return -EBUSY;
			return -EBUSY;
		} else {
		} else {