summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/smsc75xx.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-05-04 08:21:02 +0200
committerDavid S. Miller <davem@davemloft.net>2016-05-04 22:58:56 +0200
commit58ef6a3f64bd837e107a2bbf0571574850a32b8c (patch)
tree786af91757a76e41fbe6554bef09f4602f856d31 /drivers/net/usb/smsc75xx.c
parenttcp: must block bh in __inet_twsk_hashdance() (diff)
downloadlinux-58ef6a3f64bd837e107a2bbf0571574850a32b8c.tar.xz
linux-58ef6a3f64bd837e107a2bbf0571574850a32b8c.zip
usbnet/smsc75xx: silence uninitialized variable warning
If the fn() calls fail then "buf" is uninitialized. Just return early in that situation. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/smsc75xx.c')
-rw-r--r--drivers/net/usb/smsc75xx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index c369db99c005..9af9799935db 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -99,9 +99,11 @@ static int __must_check __smsc75xx_read_reg(struct usbnet *dev, u32 index,
ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
| USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0, index, &buf, 4);
- if (unlikely(ret < 0))
+ if (unlikely(ret < 0)) {
netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
index, ret);
+ return ret;
+ }
le32_to_cpus(&buf);
*data = buf;