mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
mctp: check register_netdevice_notifier() error in mctp_device_init()
mctp_device_init() handles errors from rtnl_af_register() and
rtnl_register_many(), but ignores the return value of
register_netdevice_notifier(). If notifier registration fails, init can
still return success while the module is only partially initialized.
Check the notifier registration error and fail module init early.
Fixes: 583be982d9 ("mctp: Add device handling and netlink interface")
Signed-off-by: Minhong He <heminhong@kylinos.cn>
Link: https://patch.msgid.link/20260720072518.112614-1-heminhong@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
c3f2fc231a
commit
d9a33cadc7
|
|
@ -536,7 +536,9 @@ int __init mctp_device_init(void)
|
|||
{
|
||||
int err;
|
||||
|
||||
register_netdevice_notifier(&mctp_dev_nb);
|
||||
err = register_netdevice_notifier(&mctp_dev_nb);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = rtnl_af_register(&mctp_af_ops);
|
||||
if (err)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user