Re: [PATCH net] net: phy: dp83848: check phy_read() return value in config_init()

From: Xuanqiang Luo

Date: Wed Sep 02 2026 - 04:23:51 EST



在 2026/9/2 14:58, Donggeun Yoo 写道:
dp83848_config_init() reads BMCR to detect whether auto-negotiation is
enabled, but does not check the phy_read() return value. On an MDIO read
failure phy_read() returns a negative errno, which is then used directly
in a bitwise test; the auto-negotiation state is left undefined while
config_init() still reports success.

Check the return value and propagate the error.

Fixes: b718e8c8f4f5 ("net: phy: dp83822: use BMCR_ANENABLE instead of BMSR_ANEGCAPABLE for DP83620")
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@xxxxxxxxx>

Reviewed-by: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>

Thanks,
Xuanqiang