From 5cc283b781398a02c8a7c919cf4d5dbb5fa8add2 Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Sat, 18 Sep 2021 14:49:55 +0300 Subject: [PATCH] net: dsa: pass CPU port fixed PHY to .port_disable While adding the logic for DSA to register a fixed-link PHY for the CPU port, I forgot to pass it to the .port_disable method too, just .port_enable. Bug had no impact for felix_switch.c, due to the phy argument not being used, but ksz9477.c does use it => NULL pointer dereference. Fixes: fc054d563bfb ("net: Introduce DSA class for Ethernet switches") Signed-off-by: Vladimir Oltean Reviewed-by: Ramon Fried --- net/dsa-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dsa-uclass.c b/net/dsa-uclass.c index 9b8ae1e82b..d1c6c78acd 100644 --- a/net/dsa-uclass.c +++ b/net/dsa-uclass.c @@ -100,7 +100,7 @@ static void dsa_port_stop(struct udevice *pdev) port_pdata = dev_get_parent_plat(pdev); ops->port_disable(dev, port_pdata->index, port_pdata->phy); - ops->port_disable(dev, priv->cpu_port, NULL); + ops->port_disable(dev, priv->cpu_port, priv->cpu_port_fixed_phy); } eth_get_ops(master)->stop(master); -- 2.39.5