All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hanson Wang <hanson.wang@ugreen.com>
To: netdev@vger.kernel.org
Cc: linux-usb@vger.kernel.org, oneukum@suse.com,
	jakub.kicinski@kernel.org, andrew+netdev@lunn.ch,
	hanson.wang@ugreen.com
Subject: [PATCH net v2] net: usb: aqc111: fix set_mac_address return value
Date: Fri, 16 Oct 2026 20:29:44 +0800	[thread overview]
Message-ID: <20261016122944.1889622-1-hanson.wang@ugreen.com> (raw)
In-Reply-To: <20260703073936.462231-1-hanson.wang@ugreen.com>

aqc111_set_mac_addr() returns the result of aqc111_write_cmd() on
success. That function wraps usb_control_msg(), which returns the
number of bytes transferred (6 for ETH_ALEN) rather than zero.

Callers such as netif_set_mac_address() and bonding treat any
non-zero return value as failure when setting the MAC address.

Return 0 on success and propagate negative error codes on failure.

Link: https://lore.kernel.org/netdev/20260703073936.462231-1-hanson.wang@ugreen.com

Signed-off-by: Hanson Wang <hanson.wang@ugreen.com>
---
 drivers/net/usb/aqc111.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c
index 9201ee10a..827aab540 100644
--- a/drivers/net/usb/aqc111.c
+++ b/drivers/net/usb/aqc111.c
@@ -476,8 +476,12 @@ static int aqc111_set_mac_addr(struct net_device *net, void *p)
 		return ret;
 
 	/* Set the MAC address */
-	return aqc111_write_cmd(dev, AQ_ACCESS_MAC, SFR_NODE_ID, ETH_ALEN,
-				ETH_ALEN, net->dev_addr);
+	ret = aqc111_write_cmd(dev, AQ_ACCESS_MAC, SFR_NODE_ID,
+			       ETH_ALEN, ETH_ALEN, net->dev_addr);
+	if (ret < 0)
+		return ret;
+
+	return 0;
 }
 
 static int aqc111_vlan_rx_kill_vid(struct net_device *net,
-- 
2.34.1


  parent reply	other threads:[~2026-10-16 12:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03  7:39 [PATCH 1/1] net: usb: aqc111: fix set_mac_address return value for bonding Hanson Wang
2026-07-03 16:46 ` Andrew Lunn
2026-07-04  8:42   ` Hanson Wang
2026-07-04 14:32     ` Andrew Lunn
2026-07-20 23:38 ` Jakub Kicinski
2026-10-16 12:29 ` Hanson Wang [this message]
2026-10-16 12:33   ` [PATCH net v2] net: usb: aqc111: fix set_mac_address return value netdev-bot+sinfo
2026-10-16 12:39   ` sashiko-bot
2026-10-16 12:48 ` Hanson Wang
2026-10-16 12:53   ` netdev-bot+sinfo
2026-10-16 12:59   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261016122944.1889622-1-hanson.wang@ugreen.com \
    --to=hanson.wang@ugreen.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=jakub.kicinski@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.