Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58ef6a3f authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

usbnet/smsc75xx: silence uninitialized variable warning



If the fn() calls fail then "buf" is uninitialized.  Just return early
in that situation.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 614bdd4d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;