Skip to content

Commit d3faab9

Browse files
oneukumdavem330
authored andcommitted
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: Oliver Neukum <[email protected]> Fixes: 405b0d6 ("net: usb: aqc111: fix error handling of usbnet read calls") Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 27eab4c commit d3faab9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/usb/aqc111.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ static int aqc111_read_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value,
3131
USB_RECIP_DEVICE, value, index, data, size);
3232

3333
if (unlikely(ret < size)) {
34-
ret = ret < 0 ? ret : -ENODATA;
35-
3634
netdev_warn(dev->net,
3735
"Failed to read(0x%x) reg index 0x%04x: %d\n",
3836
cmd, index, ret);
37+
38+
ret = ret < 0 ? ret : -ENODATA;
3939
}
4040

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

5252
if (unlikely(ret < size)) {
53-
ret = ret < 0 ? ret : -ENODATA;
54-
5553
netdev_warn(dev->net,
5654
"Failed to read(0x%x) reg index 0x%04x: %d\n",
5755
cmd, index, ret);
56+
57+
ret = ret < 0 ? ret : -ENODATA;
5858
}
5959

6060
return ret;

0 commit comments

Comments
 (0)