[PATCH] net: mvpp2: fix NULL pointer dereference in mvpp2_phy_connect
Stefan Roese
stefan.roese at mailbox.org
Wed Jun 10 14:21:18 CEST 2026
On 12/16/25 01:53, Vincent Jardin wrote:
> Fix two NULL pointer dereferences in mvpp2_phy_connect():
>
> 1. port->phy_dev->dev is used in dev_warn() but
> port->phy_dev is not assigned yet (assigned later at line below).
>
> 2. port->phy_dev->dev is used in dev_err() inside
> the "if (!phy_dev)" block, which means phy_dev is NULL.
>
> Both cases would cause a crash if the PHY detection fails or returns
> a generic PHY. Use the already available 'dev' parameter instead.
>
> Fixes: 9db60ee470c2 ("net: mvpp2: Convert netdev_xxx to dev_xxx")
> Signed-off-by: Vincent Jardin <vjardin at free.fr>
Applied to u-boot-marvell/next
Thanks,
Stefan
More information about the U-Boot
mailing list