mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Xinsheng Zhu <xinsheng.zhu.ny@gmail.com>
Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: usb: ax88172a: improve MAC address read error handling
Date: Mon, 28 Sep 2026 18:59:37 +0200	[thread overview]
Message-ID: <c17d456a-cf01-41cc-9039-dc17271b1dd2@lunn.ch> (raw)
In-Reply-To: <20260928044011.63926-1-xinsheng.zhu.ny@gmail.com>

On Mon, Sep 28, 2026 at 12:40:11AM -0400, Xinsheng Zhu wrote:
> When retrieving the MAC address, ax88172a_bind() checks the return
> value of asix_read_cmd() against ETH_ALEN to detect short reads.
> Commit c28d9a285668 ("ax88172a: fix ax88172a_unbind() failures") added
> an -EIO assignment to ensure that this failure path returns a negative
> error code, even when asix_read_cmd() returns a non-negative short-read
> length.
> 
> Short-read handling was subsequently added to asix_read_cmd() by commit
> 920a9fa27e78 ("net: asix: add proper error handling of usb read errors").
> The helper now converts short reads to -ENODATA while preserving
> negative errors from the underlying USB read operation.
> 
> The MAC address short-read check in ax88172a_bind() is therefore
> redundant now, and overwriting the return value with -EIO is no longer
> necessary to ensure that the failure path returns a negative error code.
> 
> Check only for negative return values and remove the -EIO assignment
> to preserve the error returned by asix_read_cmd() through the existing
> cleanup path.
> 
> Signed-off-by: Xinsheng Zhu <xinsheng.zhu.ny@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

  reply	other threads:[~2026-09-28 16:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  4:40 Xinsheng Zhu
2026-09-28 16:59 ` Andrew Lunn [this message]
2026-09-30 23:40 ` patchwork-bot+netdevbpf

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=c17d456a-cf01-41cc-9039-dc17271b1dd2@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xinsheng.zhu.ny@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®