From: Artem Chernyshev <artem.chernyshev@red-soft.ru>
To: Sven Eckelmann <sven@narfation.org>
Cc: Artem Chernyshev <artem.chernyshev@red-soft.ru>,
Marek Lindner <mareklindner@neomailbox.ch>,
Simon Wunderlich <sw@simonwunderlich.de>,
b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: [PATCH] batman-adv: Check return value
Date: Sun, 25 Dec 2022 02:33:11 +0300 [thread overview]
Message-ID: <20221224233311.48678-1-artem.chernyshev@red-soft.ru> (raw)
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@red-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
next reply other threads:[~2022-12-24 23:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-24 23:33 Artem Chernyshev [this message]
2022-12-25 6:37 ` [PATCH] batman-adv: Check return value Sven Eckelmann
2022-12-25 9:47 ` Artem Chernyshev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221224233311.48678-1-artem.chernyshev@red-soft.ru \
--to=artem.chernyshev@red-soft.ru \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=mareklindner@neomailbox.ch \
--cc=netdev@vger.kernel.org \
--cc=sven@narfation.org \
--cc=sw@simonwunderlich.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).