diff options
| author | Jijie Shao <shaojijie@huawei.com> | 2026-10-16 19:04:21 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-21 17:13:07 -0700 |
| commit | 9b8ae9aaa1b8e2b6c1cbf5613d3a37923cf53bc5 (patch) | |
| tree | 4e5e9afd8197ea9aa90638c6b39afd2f210c86d5 /scripts/Makefile.thinlto | |
| parent | abeacca61eea4f6803df4a595b656ea45c2d3249 (diff) | |
| download | linux-9b8ae9aaa1b8e2b6c1cbf5613d3a37923cf53bc5.tar.gz linux-9b8ae9aaa1b8e2b6c1cbf5613d3a37923cf53bc5.zip | |
net: hibmcge: set netdev_ops before hbg_init() to fix NULL pointer dereference
The driver assigns netdev_ops after hbg_init(), but hbg_init() calls
hbg_mdio_init() -> hbg_phy_connect() -> phy_connect_direct() ->
phy_attach_direct() -> phy_link_topo_add_phy(), which invokes
netdev_need_ops_lock(). With CONFIG_NET_SHAPER enabled, this function
dereferences dev->netdev_ops->net_shaper_ops. Since netdev_ops is still
NULL at this point, a NULL pointer dereference occurs.
Move the netdev_ops assignment before hbg_init() so that
netdev_need_ops_lock() can safely access netdev_ops during PHY
attachment.
The issue was hit and verified on an evaluation board.
Fixes: ff4edac6e9bd ("net: hibmcge: Implement some .ndo functions")
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261016110421.2288670-1-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
