linux/drivers/net/ethernet/ti/icssm
David Yang 955bb7cf68 net: ti: icssm-prueth: Move setting of netops to fix crash
icssm_prueth_netdev_init() calls of_phy_get_and_connect() before
ndev->netdev_ops is assigned. phy_attach_direct() ->
phy_link_topo_add_phy() reads dev->netdev_ops through
netdev_need_ops_lock() since the commit in question, so probing crashes
with a NULL pointer dereference when CONFIG_NET_SHAPER is enabled.

Assign netdev_ops before the PHY attach, as was done for emac in commit
7c9f391ec8 ("net: emac: move setting of netops to fix crash").

Fixes: ded86da4bb ("net: ethtool: relax ethnl_req_get_phydev() locking assertion")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20261008022656.3592191-10-mmyangfl@gmail.com
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-10-15 10:39:21 +02:00
..
icssm_prueth_fdb_tbl.h net: ti: icssm-prueth: Add helper functions to configure and maintain FDB 2026-02-04 18:12:00 -08:00
icssm_prueth_ptp.h net: ti: icssm-prueth: Adds IEP support for PRUETH on AM33x, AM43x and AM57x SOCs 2025-09-14 13:00:54 -07:00
icssm_prueth_switch.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
icssm_prueth_switch.h net: ti: icssm-prueth: Add support for ICSSM RSTP switch 2026-02-04 18:12:00 -08:00
icssm_prueth.c net: ti: icssm-prueth: Move setting of netops to fix crash 2026-10-15 10:39:21 +02:00
icssm_prueth.h net: ti: icssm-prueth: Add support for ICSSM RSTP switch 2026-02-04 18:12:00 -08:00
icssm_switch.h net: ti: icssm-prueth: Add support for ICSSM RSTP switch 2026-02-04 18:12:00 -08:00
icssm_switchdev.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
icssm_switchdev.h net: ti: icssm-prueth: Add switchdev support for icssm_prueth driver 2026-02-04 18:12:00 -08:00
icssm_vlan_mcast_filter_mmap.h net: ti: icssm-prueth: Add switchdev support for icssm_prueth driver 2026-02-04 18:12:00 -08:00