Unverified Commit 6bb06684 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4987 net: usb: smsc75xx: Fix uninit-value access in __smsc75xx_read_reg

parents f470ef88 0570a2fa
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -90,7 +90,9 @@ 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 < 4)) {
		ret = ret < 0 ? ret : -ENODATA;

		netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
			    index, ret);
		return ret;