diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/usbnet.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 0ac1ff3571cb..5bf77171f452 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1670,8 +1670,14 @@ out: | |||
1670 | int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, | 1670 | int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, |
1671 | u16 value, u16 index, void *data, u16 size) | 1671 | u16 value, u16 index, void *data, u16 size) |
1672 | { | 1672 | { |
1673 | return __usbnet_read_cmd(dev, cmd, reqtype, value, index, | 1673 | int ret; |
1674 | data, size); | 1674 | |
1675 | if (usb_autopm_get_interface(dev->intf) < 0) | ||
1676 | return -ENODEV; | ||
1677 | ret = __usbnet_read_cmd(dev, cmd, reqtype, value, index, | ||
1678 | data, size); | ||
1679 | usb_autopm_put_interface(dev->intf); | ||
1680 | return ret; | ||
1675 | } | 1681 | } |
1676 | EXPORT_SYMBOL_GPL(usbnet_read_cmd); | 1682 | EXPORT_SYMBOL_GPL(usbnet_read_cmd); |
1677 | 1683 | ||
@@ -1682,8 +1688,14 @@ EXPORT_SYMBOL_GPL(usbnet_read_cmd); | |||
1682 | int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, | 1688 | int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, |
1683 | u16 value, u16 index, const void *data, u16 size) | 1689 | u16 value, u16 index, const void *data, u16 size) |
1684 | { | 1690 | { |
1685 | return __usbnet_write_cmd(dev, cmd, reqtype, value, index, | 1691 | int ret; |
1686 | data, size); | 1692 | |
1693 | if (usb_autopm_get_interface(dev->intf) < 0) | ||
1694 | return -ENODEV; | ||
1695 | ret = __usbnet_write_cmd(dev, cmd, reqtype, value, index, | ||
1696 | data, size); | ||
1697 | usb_autopm_put_interface(dev->intf); | ||
1698 | return ret; | ||
1687 | } | 1699 | } |
1688 | EXPORT_SYMBOL_GPL(usbnet_write_cmd); | 1700 | EXPORT_SYMBOL_GPL(usbnet_write_cmd); |
1689 | 1701 | ||