net: lapbether: check register_netdevice_notifier() error in lapbeth_init_driver()
Subsystems (3)
PATCH 1/1 net: lapbether: check register_netdevice_notifier() error in lapbeth_init_driver()
lapbeth_init_driver() ignores register_netdevice_notifier() errors and always returns success, which can leave the module loaded without its netdev notifier registered.
Check the error and remove the packet type on failure.
--- drivers/net/wan/lapbether.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wan/lapbether.c +7 -1
@@ -497,9 +497,15 @@ static const char banner[] __initconst =static int __init lapbeth_init_driver (void ) { +int err; +dev_add_pack (&lapbeth_packet_type); -register_netdevice_notifier (&lapbeth_dev_notifier); + err =register_netdevice_notifier (&lapbeth_dev_notifier); +if (err) { +dev_remove_pack (&lapbeth_packet_type); +return err; + }printk (banner);
Signature · 1 line
2.25.1
From: Minhong He <[email protected]>
Sent: Monday, August 3, 2026 11:00 AM
Quoted 7 lines
lapbeth_init_driver()ignoresregister_netdevice_notifier()errors and always returns success, which can leave the module loaded without its netdev notifier registered.Check the error and remove the packet type on failure.
Signed-off-by Minhong He <[email protected]>
Hi Minhong
why do not gather all the patches into single series, all of them seem to be doing similar things. that could help to deal with them in more organized way
I believe also fixes tags might be missing
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Mon, 3 Aug 2026 16:59:36 +0800 you wrote:
lapbeth_init_driver()ignoresregister_netdevice_notifier()errors and always returns success, which can leave the module loaded without its netdev notifier registered.Check the error and remove the packet type on failure.
Signed-off-by Minhong He <[email protected]>[...]
Here is the summary with links:
- [net] net: lapbether: check register_netdevice_notifier() error in lapbeth_init_driver()
https://git.kernel.org/netdev/net-next/c/e43e9d7cabac
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html