Skip to content

Commit e333eed

Browse files
Fabio Estevamkuba-moo
Fabio Estevam
authored andcommitted
net: phy: micrel: Do not use kszphy_suspend/resume for KSZ8061
Since commit f1131b9 ("net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices") the following NULL pointer dereference is observed on a board with KSZ8061: # udhcpc -i eth0 udhcpc: started, v1.35.0 8<--- cut here --- Unable to handle kernel NULL pointer dereference at virtual address 00000008 pgd = f73cef4e [00000008] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: CPU: 0 PID: 196 Comm: ifconfig Not tainted 5.15.37-dirty #94 Hardware name: Freescale i.MX6 SoloX (Device Tree) PC is at kszphy_config_reset+0x10/0x114 LR is at kszphy_resume+0x24/0x64 ... The KSZ8061 phy_driver structure does not have the .probe/..driver_data fields, which means that priv is not allocated. This causes the NULL pointer dereference inside kszphy_config_reset(). Fix the problem by using the generic suspend/resume functions as before. Another alternative would be to provide the .probe and .driver_data information into the structure, but to be on the safe side, let's just restore Ethernet functionality by using the generic suspend/resume. Cc: [email protected] Fixes: f1131b9 ("net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices") Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6997fbd commit e333eed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/phy/micrel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2782,8 +2782,8 @@ static struct phy_driver ksphy_driver[] = {
27822782
.config_init = ksz8061_config_init,
27832783
.config_intr = kszphy_config_intr,
27842784
.handle_interrupt = kszphy_handle_interrupt,
2785-
.suspend = kszphy_suspend,
2786-
.resume = kszphy_resume,
2785+
.suspend = genphy_suspend,
2786+
.resume = genphy_resume,
27872787
}, {
27882788
.phy_id = PHY_ID_KSZ9021,
27892789
.phy_id_mask = 0x000ffffe,

0 commit comments

Comments
 (0)