mctp: check register_netdevice_notifier() error in mctp_device_init()
authorMinhong He <heminhong@kylinos.cn>
Mon, 20 Jul 2026 07:25:18 +0000 (15:25 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 23 Jul 2026 16:17:36 +0000 (09:17 -0700)
commitd9a33cadc70a94c1582f65e6042e81027cd200c6
treeda4c9b3839676e4c7f350248e864c97d26e36e77
parentc3f2fc231a39e29fe9f0adc14a3ecc3c1260d3c5
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: 583be982d934 ("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>
net/mctp/device.c