Re: [PATCH net] net: ethtool: phy: avoid NULL deref when PHY driver is unbound

From: patchwork-bot+netdevbpf

Date: Tue May 12 2026 - 23:46:37 EST


Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@xxxxxxxxxx>:

On Sat, 9 May 2026 22:50:46 +0100 you wrote:
> phydev->drv can become NULL while the phy_device is still attached to
> its net_device, namely after the PHY driver is unbound via sysfs:
>
> echo <mdio_id> > /sys/bus/mdio_bus/drivers/<phy_drv>/unbind
>
> phy_remove() clears phydev->drv but doesn't call phy_detach(), so the
> phy_device stays in the link topology xarray and ethnl_req_get_phydev()
> still hands it back. ETHTOOL_MSG_PHY_GET then oopses on:
>
> [...]

Here is the summary with links:
- [net] net: ethtool: phy: avoid NULL deref when PHY driver is unbound
https://git.kernel.org/netdev/net/c/e3adf69f8eb1

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html