diff options
Diffstat (limited to 'net/hsr/hsr_main.c')
-rw-r--r-- | net/hsr/hsr_main.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net/hsr/hsr_main.c b/net/hsr/hsr_main.c index 2fd1976e5..bea7f935f 100644 --- a/net/hsr/hsr_main.c +++ b/net/hsr/hsr_main.c @@ -137,14 +137,21 @@ static struct notifier_block hsr_nb = { static int __init hsr_init(void) { - int res; + int err; BUILD_BUG_ON(sizeof(struct hsr_tag) != HSR_HLEN); - register_netdevice_notifier(&hsr_nb); - res = hsr_netlink_init(); + err = register_netdevice_notifier(&hsr_nb); + if (err) + return err; + + err = hsr_netlink_init(); + if (err) { + unregister_netdevice_notifier(&hsr_nb); + return err; + } - return res; + return 0; } static void __exit hsr_exit(void) |