[29/30] net: Add missing annotation for netlink_walk_start()
diff mbox series

Message ID 20200214204741.94112-30-jbi.octave@gmail.com
State Not Applicable
Delegated to: David Miller
Headers show
  • Untitled series #158661
Related show

Commit Message

Jules Irenge Feb. 14, 2020, 8:47 p.m. UTC
Sparse reports a warning at netlink_walk_start()

warning: context imbalance in netlink_walk_start()
	 - wrong count at exit

The root cause is the missing annotation at netlink_walk_start()
A close look at rhashtable_walk_start_check()
shows that an __acquires(RCU) is needed here.

Add the missing __acquires(RCU) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
 net/netlink/af_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 4e31721e7293..a3fddc845538 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2539,7 +2539,7 @@  struct nl_seq_iter {
 	int link;
-static void netlink_walk_start(struct nl_seq_iter *iter)
+static void netlink_walk_start(struct nl_seq_iter *iter) __acquires(RCU)
 	rhashtable_walk_enter(&nl_table[iter->link].hash, &iter->hti);