[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181224174926.20321-1-pakki001@umn.edu>
Date: Mon, 24 Dec 2018 11:49:26 -0600
From: Aditya Pakki <pakki001@....edu>
To: pakki001@....edu
Cc: kjlu@....edu, Marek Lindner <mareklindner@...mailbox.ch>,
Simon Wunderlich <sw@...onwunderlich.de>,
Antonio Quartulli <a@...table.cc>,
"David S. Miller" <davem@...emloft.net>,
b.a.t.m.a.n@...ts.open-mesh.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] batman-adv/main: Fix check on return value of rtnl_link_register
rtnl_link_register() may fail and can impact registering the device.
The fix checks the return value and pushes the error upstream.
Signed-off-by: Aditya Pakki <pakki001@....edu>
---
net/batman-adv/main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 69c0d85bceb3..e0007f242823 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -109,7 +109,10 @@ static int __init batadv_init(void)
batadv_debugfs_init();
register_netdevice_notifier(&batadv_hard_if_notifier);
- rtnl_link_register(&batadv_link_ops);
+ ret = rtnl_link_register(&batadv_link_ops);
+ if (ret < 0)
+ return ret;
+
batadv_netlink_register();
pr_info("B.A.T.M.A.N. advanced %s (compatibility version %i) loaded\n",
--
2.17.1
Powered by blists - more mailing lists