Commit d3faab9b authored by Oliver Neukum's avatar Oliver Neukum Committed by David S. Miller
Browse files

net: usb: aqc111: debug info before sanitation



If we sanitize error returns, the debug statements need
to come before that so that we don't lose information.

Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Fixes: 405b0d61 ("net: usb: aqc111: fix error handling of usbnet read calls")
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 27eab4c6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -31,11 +31,11 @@ static int aqc111_read_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value,
				   USB_RECIP_DEVICE, value, index, data, size);

	if (unlikely(ret < size)) {
		ret = ret < 0 ? ret : -ENODATA;

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

		ret = ret < 0 ? ret : -ENODATA;
	}

	return ret;
@@ -50,11 +50,11 @@ static int aqc111_read_cmd(struct usbnet *dev, u8 cmd, u16 value,
			      USB_RECIP_DEVICE, value, index, data, size);

	if (unlikely(ret < size)) {
		ret = ret < 0 ? ret : -ENODATA;

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

		ret = ret < 0 ? ret : -ENODATA;
	}

	return ret;