All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv/main: Fix check on return value of rtnl_link_register
@ 2018-12-24 17:49 ` Aditya Pakki
  0 siblings, 0 replies; 6+ messages in thread
From: Aditya Pakki @ 2018-12-24 17:49 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Marek Lindner, Simon Wunderlich, Antonio Quartulli,
	David S. Miller, b.a.t.m.a.n, netdev, linux-kernel

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@umn.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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-12-24 18:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-24 17:49 [B.A.T.M.A.N.] [PATCH] batman-adv/main: Fix check on return value of rtnl_link_register Aditya Pakki
2018-12-24 17:49 ` Aditya Pakki
2018-12-24 18:43 ` [B.A.T.M.A.N.] " Sven Eckelmann
2018-12-24 18:43   ` Sven Eckelmann
2018-12-24 18:46 ` [B.A.T.M.A.N.] " Sven Eckelmann
2018-12-24 18:46   ` Sven Eckelmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.