[PATCH] rtnl: reset calcit fptr in rtnl_unregister()

Subsystems: networking [general], the rest

STALE3562d

2 messages, 2 authors, 2016-11-10 · open the first message on its own page

[PATCH] rtnl: reset calcit fptr in rtnl_unregister()

From: Mathias Krause <hidden>
Date: 2016-11-07 22:22:33

To avoid having dangling function pointers left behind, reset calcit in
rtnl_unregister(), too.

This is no issue so far, as only the rtnl core registers a netlink
handler with a calcit hook which won't be unregistered, but may become
one if new code makes use of the calcit hook.

Fixes: c7ac8679bec9 ("rtnetlink: Compute and store minimum ifinfo...")
Cc: Jeff Kirsher <redacted>
Cc: Greg Rose <redacted>
Signed-off-by: Mathias Krause <redacted>
---
 net/core/rtnetlink.c |    1 +
 1 file changed, 1 insertion(+)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 189cc78c77eb..d4c601604bf7 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -275,6 +275,7 @@ int rtnl_unregister(int protocol, int msgtype)
 
 	rtnl_msg_handlers[protocol][msgindex].doit = NULL;
 	rtnl_msg_handlers[protocol][msgindex].dumpit = NULL;
+	rtnl_msg_handlers[protocol][msgindex].calcit = NULL;
 
 	return 0;
 }
-- 
1.7.10.4

Re: [PATCH] rtnl: reset calcit fptr in rtnl_unregister()

From: David Miller <davem@davemloft.net>
Date: 2016-11-10 01:18:40

From: Mathias Krause <redacted>
Date: Mon,  7 Nov 2016 23:22:19 +0100
To avoid having dangling function pointers left behind, reset calcit in
rtnl_unregister(), too.

This is no issue so far, as only the rtnl core registers a netlink
handler with a calcit hook which won't be unregistered, but may become
one if new code makes use of the calcit hook.

Fixes: c7ac8679bec9 ("rtnetlink: Compute and store minimum ifinfo...")
Cc: Jeff Kirsher <redacted>
Cc: Greg Rose <redacted>
Signed-off-by: Mathias Krause <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help