[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221224233311.48678-1-artem.chernyshev@red-soft.ru>
Date: Sun, 25 Dec 2022 02:33:11 +0300
From: Artem Chernyshev <artem.chernyshev@...-soft.ru>
To: Sven Eckelmann <sven@...fation.org>
Cc: Artem Chernyshev <artem.chernyshev@...-soft.ru>,
Marek Lindner <mareklindner@...mailbox.ch>,
Simon Wunderlich <sw@...onwunderlich.de>,
b.a.t.m.a.n@...ts.open-mesh.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, lvc-project@...uxtesting.org
Subject: [PATCH] batman-adv: Check return value
Check, if rtnl_link_register() call in batadv_init() was successful
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: a4ac28c0d06a ("batman-adv: Allow to use rntl_link for device creation/deletion")
Signed-off-by: Artem Chernyshev <artem.chernyshev@...-soft.ru>
---
net/batman-adv/main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index e8a449915566..04cd9682bd29 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -113,7 +113,11 @@ static int __init batadv_init(void)
goto err_create_wq;
register_netdevice_notifier(&batadv_hard_if_notifier);
- rtnl_link_register(&batadv_link_ops);
+ ret = rtnl_link_register(&batadv_link_ops);
+ if (ret) {
+ pr_err("Can't register link_ops\n");
+ goto err_create_wq;
+ }
batadv_netlink_register();
pr_info("B.A.T.M.A.N. advanced %s (compatibility version %i) loaded\n",
--
2.30.3
Powered by blists - more mailing lists