Skip to content

Commit 53cd682

Browse files
minimaxwellkuba-moo
authored andcommitted
net: stmmac: Call xpcs_config_eee_mult_fact() only when xpcs is present
Some dwmac variants such as dwmac_socfpga don't use xpcs but lynx_pcs. Don't call xpcs_config_eee_mult_fact() in this case, as this causes a crash at init : Unable to handle kernel NULL pointer dereference at virtual address 00000039 when write [...] Call trace: xpcs_config_eee_mult_fact from stmmac_pcs_setup+0x40/0x10c stmmac_pcs_setup from stmmac_dvr_probe+0xc0c/0x1244 stmmac_dvr_probe from socfpga_dwmac_probe+0x130/0x1bc socfpga_dwmac_probe from platform_probe+0x5c/0xb0 Fixes: 060fb27 ("net: stmmac: call xpcs_config_eee_mult_fact()") Signed-off-by: Maxime Chevallier <[email protected]> Reviewed-by: Russell King (Oracle) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c61209e commit 53cd682

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ int stmmac_pcs_setup(struct net_device *ndev)
524524
if (ret)
525525
return dev_err_probe(priv->device, ret, "No xPCS found\n");
526526

527-
xpcs_config_eee_mult_fact(xpcs, priv->plat->mult_fact_100ns);
527+
if (xpcs)
528+
xpcs_config_eee_mult_fact(xpcs, priv->plat->mult_fact_100ns);
528529

529530
priv->hw->xpcs = xpcs;
530531

0 commit comments

Comments
 (0)