Commit 5a36b68b authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

usbnet: smsc95xx: silence an uninitialized variable warning

If the call to fn() fails then "buf" is uninitialized.  Just return the
error code in that case.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58ef6a3f
...@@ -92,9 +92,11 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, ...@@ -92,9 +92,11 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
| USB_TYPE_VENDOR | USB_RECIP_DEVICE, | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0, index, &buf, 4); 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", netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
index, ret); index, ret);
return ret;
}
le32_to_cpus(&buf); le32_to_cpus(&buf);
*data = buf; *data = buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment