summaryrefslogtreecommitdiff
path: root/net/devlink/core.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2024-03-18 09:47:52 -0700
committerAndrew Morton <akpm@linux-foundation.org>2024-03-18 09:47:52 -0700
commit5e28061128646febc71c0942609619e29f41ff00 (patch)
tree9fc836e739a4f1f312a9891c6f6a675cd325959f /net/devlink/core.c
parent270700dd06ca41a4779c19eb46608f076bb7d40e (diff)
parente8f897f4afef0031fe618a8e94127a0934896aba (diff)
Merge branch 'master' into mm-stable
Diffstat (limited to 'net/devlink/core.c')
-rw-r--r--net/devlink/core.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/devlink/core.c b/net/devlink/core.c
index 6a58342752b4..7f0b093208d7 100644
--- a/net/devlink/core.c
+++ b/net/devlink/core.c
@@ -529,14 +529,20 @@ static int __init devlink_init(void)
{
int err;
- err = genl_register_family(&devlink_nl_family);
- if (err)
- goto out;
err = register_pernet_subsys(&devlink_pernet_ops);
if (err)
goto out;
+ err = genl_register_family(&devlink_nl_family);
+ if (err)
+ goto out_unreg_pernet_subsys;
err = register_netdevice_notifier(&devlink_port_netdevice_nb);
+ if (!err)
+ return 0;
+
+ genl_unregister_family(&devlink_nl_family);
+out_unreg_pernet_subsys:
+ unregister_pernet_subsys(&devlink_pernet_ops);
out:
WARN_ON(err);
return err;