aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h
diff options
context:
space:
mode:
authorNiklas Söderlund <[email protected]>2024-09-03 17:15:36 +0000
committerJakub Kicinski <[email protected]>2024-09-05 00:01:21 +0000
commit569bf6d481b0b823c3c9c3b8be77908fd7caf66b (patch)
treea3c7c6f7dd11b70ea5cea9edbf6af56e0ea09d52 /drivers/net/wireless/intel/iwlwifi/fw/api/commands.h
parentpds_core: Remove redundant null pointer checks (diff)
downloadkernel-569bf6d481b0b823c3c9c3b8be77908fd7caf66b.tar.gz
kernel-569bf6d481b0b823c3c9c3b8be77908fd7caf66b.zip
net: phy: Check for read errors in SIOCGMIIREG
When reading registers from the PHY using the SIOCGMIIREG IOCTL any errors returned from either mdiobus_read() or mdiobus_c45_read() are ignored, and parts of the returned error is passed as the register value back to user-space. For example, if mdiobus_c45_read() is used with a bus that do not implement the read_c45() callback -EOPNOTSUPP is returned. This is however directly stored in mii_data->val_out and returned as the registers content. As val_out is a u16 the error code is truncated and returned as a plausible register value. Fix this by first checking the return value for errors before returning it as the register content. Before this patch, # phytool read eth0/0:1/0 0xffa1 After this change, $ phytool read eth0/0:1/0 error: phy_read (-95) Signed-off-by: Niklas Söderlund <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Tested-by: Yoshihiro Shimoda <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/fw/api/commands.h')
0 files changed, 0 insertions, 0 deletions