* [PATCH net] net: lapbether: check register_netdevice_notifier() error in lapbeth_init_driver()
@ 2026-08-03 8:59 Minhong He
2026-08-03 11:23 ` Jagielski, Jedrzej
2026-08-05 2:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Minhong He @ 2026-08-03 8:59 UTC (permalink / raw)
To: Martin Schiller, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-x25, netdev
Cc: linux-kernel
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.
Signed-off-by: Minhong He <heminhong@kylinos.cn>
---
drivers/net/wan/lapbether.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 9861c99ea56c..c3630a82913b 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -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);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH net] net: lapbether: check register_netdevice_notifier() error in lapbeth_init_driver()
2026-08-03 8:59 [PATCH net] net: lapbether: check register_netdevice_notifier() error in lapbeth_init_driver() Minhong He
@ 2026-08-03 11:23 ` Jagielski, Jedrzej
2026-08-05 2:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jagielski, Jedrzej @ 2026-08-03 11:23 UTC (permalink / raw)
To: Minhong He, Martin Schiller, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni,
linux-x25@vger.kernel.org, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
From: Minhong He <heminhong@kylinos.cn>
Sent: Monday, August 3, 2026 11:00 AM
>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.
>
>Signed-off-by: Minhong He <heminhong@kylinos.cn>
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: lapbether: check register_netdevice_notifier() error in lapbeth_init_driver()
2026-08-03 8:59 [PATCH net] net: lapbether: check register_netdevice_notifier() error in lapbeth_init_driver() Minhong He
2026-08-03 11:23 ` Jagielski, Jedrzej
@ 2026-08-05 2:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-05 2:00 UTC (permalink / raw)
To: Minhong He
Cc: ms, andrew+netdev, davem, edumazet, kuba, pabeni, linux-x25,
netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 3 Aug 2026 16:59:36 +0800 you wrote:
> 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.
>
> Signed-off-by: Minhong He <heminhong@kylinos.cn>
>
> [...]
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-05 2:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 8:59 [PATCH net] net: lapbether: check register_netdevice_notifier() error in lapbeth_init_driver() Minhong He
2026-08-03 11:23 ` Jagielski, Jedrzej
2026-08-05 2:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox