Skip to contentSkip to conversation

net: usb: aqc111: debug info before sanitation

PATCH Applied Oliver Neukum 3 participants 3 messages May 28, 2025 – May 30, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Fixes 405b0d610745 ("net: usb: aqc111: fix error handling of usbnet read calls")
---
 drivers/net/usb/aqc111.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/usb/aqc111.c +4 -4
index 453a2cf82753..9201ee10a13f 100644
@@ -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;
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Oliver Neukum

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

Fixes 405b0d610745 ("net: usb: aqc111: fix error handling of usbnet read calls")

Is 405b0d610745 in net-next, just about to be merged this merge window?

Andrew

#2 lore raw
In reply to Oliver Neukum
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Wed, 28 May 2025 13:03:54 +0200 you wrote:

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

Fixes 405b0d610745 ("net: usb: aqc111: fix error handling of usbnet read calls")
---
 drivers/net/usb/aqc111.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Here is the summary with links:
- net: usb: aqc111: debug info before sanitation

    https://git.kernel.org/netdev/net/c/d3faab9b5a6a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html