Skip to content

Commit 9ce12eb

Browse files
tgrafdavem330
authored andcommitted
netlink: Annotate RCU locking for seq_file walker
Silences the following sparse warnings: net/netlink/af_netlink.c:2926:21: warning: context imbalance in 'netlink_seq_start' - wrong count at exit net/netlink/af_netlink.c:2972:13: warning: context imbalance in 'netlink_seq_stop' - unexpected unlock Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 93f5608 commit 9ce12eb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/netlink/af_netlink.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,6 +2921,7 @@ static struct sock *netlink_seq_socket_idx(struct seq_file *seq, loff_t pos)
29212921
}
29222922

29232923
static void *netlink_seq_start(struct seq_file *seq, loff_t *pos)
2924+
__acquires(RCU)
29242925
{
29252926
rcu_read_lock();
29262927
return *pos ? netlink_seq_socket_idx(seq, *pos - 1) : SEQ_START_TOKEN;
@@ -2970,6 +2971,7 @@ static void *netlink_seq_next(struct seq_file *seq, void *v, loff_t *pos)
29702971
}
29712972

29722973
static void netlink_seq_stop(struct seq_file *seq, void *v)
2974+
__releases(RCU)
29732975
{
29742976
rcu_read_unlock();
29752977
}

0 commit comments

Comments
 (0)