mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-22 15:18:44 +04:00
phylink_bringup_phy() stores the PHY in pl->phydev before its last step that can fail. If that step fails, the pointer outlives the failed connect: a later phylink_connect_phy() gets a permanent -EBUSY, the SFP path is left with a pointer to a freed phy_device, and a disconnect detaches the same PHY twice. The fix publishes the pointer only after the last call that can fail. It is also the base the pending phylink late-PHY series relies on: retrying a connect after a failed bringup is what makes this window reachable. The fix is in net: https://git.kernel.org/netdev/net/c/a940003f44e7 The phylink patches that apply on top of it are refreshed for hunk offsets. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> Link: https://github.com/openwrt/openwrt/pull/25459 Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>