When calling pm_runtime_get, usb_autopm_get_interface_async
treats a return value of -EINPROGRESS as a success and
increments the usage count. Since the interface is resuming,
it is safe for usbnet_start_xmit to submit the urb. If instead,
usbnet_start_xmit treats this as an error the packet will be
dropped. Additionally, a corresponding tx_complete will not
run to offset the earlier increment of the usage count from the
call to usb_autopm_get_interface_async.
Signed-off-by: James Wylder <redacted>
---
drivers/net/usb/usbnet.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index ce395fe..90849d6 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1105,7 +1105,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
spin_lock_irqsave(&dev->txq.lock, flags);
retval = usb_autopm_get_interface_async(dev->intf);
- if (retval < 0) {
+ if (retval < 0 && retval != -EINPROGRESS) {
spin_unlock_irqrestore(&dev->txq.lock, flags);
goto drop;
}--
1.7.6