mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
net: usb: ax88172a: improve MAC address read error handling
When retrieving the MAC address, ax88172a_bind() checks the return value of asix_read_cmd() against ETH_ALEN to detect short reads. Commitc28d9a2856("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 commit920a9fa27e("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> Link: https://patch.msgid.link/20260928044011.63926-1-xinsheng.zhu.ny@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
bf515c9fae
commit
b38dd3a0cf
1 changed files with 1 additions and 2 deletions
Loading…
Add table
Add a link
Reference in a new issue