diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-01-10 03:59:30 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-01-10 04:00:17 +0300 |
commit | 8aaaf2f3af2ae212428f4db1af34214225f5cec3 (patch) | |
tree | 43c7f4f8af2fad7919f169b0924dba5e43147d97 /drivers/net/usb | |
parent | 208dd45d8d050360b46ded439a057bcc7cbf3b09 (diff) | |
parent | dd3ca4c5184ea98e40acb8eb293d85b88ea04ee2 (diff) | |
download | linux-8aaaf2f3af2ae212428f4db1af34214225f5cec3.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Merge in fixes directly in prep for the 5.17 merge window.
No conflicts.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/mcs7830.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index 326cc4e749d8..fdda0616704e 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c @@ -108,8 +108,16 @@ static const char driver_name[] = "MOSCHIP usb-ethernet driver"; static int mcs7830_get_reg(struct usbnet *dev, u16 index, u16 size, void *data) { - return usbnet_read_cmd(dev, MCS7830_RD_BREQ, MCS7830_RD_BMREQ, - 0x0000, index, data, size); + int ret; + + ret = usbnet_read_cmd(dev, MCS7830_RD_BREQ, MCS7830_RD_BMREQ, + 0x0000, index, data, size); + if (ret < 0) + return ret; + else if (ret < size) + return -ENODATA; + + return ret; } static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, const void *data) |