can: isotp: check register_netdevice_notifier() error in module init
authorMinhong He <heminhong@kylinos.cn>
Wed, 29 Jul 2026 08:56:56 +0000 (16:56 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 29 Jul 2026 09:26:41 +0000 (11:26 +0200)
commitef09a13c5afac41a3c4b5f22b8572820d9e7518c
treebc584331e7e4b4c4c01a81bc904f204f5fb24c2a
parent050f010f920da17c1044a4f174766ad553e770b6
can: isotp: check register_netdevice_notifier() error in module init

Register the netdevice notifier before can_proto_register() and check the
return value. If protocol registration fails, unregister the notifier
before returning the error.

Align isotp_module_init() with the reordering already done for raw.c
(commit c28b3bffe49e ("can: raw: process optimization in raw_init()")) and
bcm.c (commit edd1a7e42f1d ("can: bcm: registration process optimization
in bcm_module_init()")).

Fixes: 8d0caedb7596 ("can: bcm/raw/isotp: use per module netdevice notifier")
Signed-off-by: Minhong He <heminhong@kylinos.cn>
Link: https://patch.msgid.link/20260729085656.134523-1-heminhong@kylinos.cn
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/isotp.c