]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: eth: create phylink before device registration 23375/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Thu, 14 May 2026 20:04:47 +0000 (22:04 +0200)
committerRobert Marko <robimarko@gmail.com>
Sun, 17 May 2026 10:23:34 +0000 (12:23 +0200)
commit965bfd55c22f3d7621c4edcad1bbb79606fd1b2e
tree1d4876c0170541bb94200125a024a0e410e664ac
parent8134e6d18744fa53d035fb65b00b9e486256af6e
realtek: eth: create phylink before device registration

As soon as devm_register_netdev returns, the network
interface is "live" and the kernel can call rteth_open().
If the interface is brought up immediately (e.g., by a
userspace script), rteth_open will attempt to call
phylink_start(ctrl->phylink), which will crash the
system because ctrl->phylink has not been assigned yet.

Reorder probing sequence.

While we are here sort the variables by length.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/23375
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.18/drivers/net/ethernet/rtl838x_eth.c