linux/net/phonet
Minhong He d1ff66b661 phonet: check register_netdevice_notifier() error in phonet_device_init()
phonet_device_init() registers a netdevice notifier before calling
phonet_netlink_register(), but does not check whether notifier
registration succeeded. On failure, netlink setup still proceeds and
init may return success without the notifier in place.

Also, the existing phonet_netlink_register() failure path called
phonet_device_exit(), which runs rtnl_unregister_all() even though
rtnl_register_many() already unwound any partial registration. Calling
the full exit helper on a partial init is not correct.

Check each registration error, including proc_create_net(), and unwind
only the steps that have succeeded so far, in reverse order.

Signed-off-by: Minhong He <heminhong@kylinos.cn>
Link: https://patch.msgid.link/20260721093956.162617-1-heminhong@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-23 10:28:50 -07:00
..
af_phonet.c bonding: prevent potential infinite loop in bond_header_parse() 2026-03-16 19:29:45 -07:00
datagram.c net: remove addr_len argument of recvmsg() handlers 2026-03-02 18:17:17 -08:00
Kconfig
Makefile
pep-gprs.c net/sock: Introduce trace_sk_data_ready() 2023-01-23 11:26:50 +00:00
pep.c phonet: pep: fix use-after-free in pep_get_sb() 2026-07-23 10:27:08 -07:00
pn_dev.c phonet: check register_netdevice_notifier() error in phonet_device_init() 2026-07-23 10:28:50 -07:00
pn_netlink.c phonet: do not call synchronize_rcu() from phonet_route_del() 2024-11-07 20:34:16 -08:00
socket.c net: phonet: do not BUG_ON() in pn_socket_autobind() on failed bind 2026-04-27 18:45:17 -07:00
sysctl.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00