OSDN Git Service

net: Add missing annotation for *netlink_seq_start()
authorJules Irenge <jbi.octave@gmail.com>
Wed, 11 Mar 2020 01:09:06 +0000 (01:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Mar 2020 06:19:41 +0000 (23:19 -0700)
Sparse reports a warning at netlink_seq_start()

warning: context imbalance in netlink_seq_start() - wrong count at exit
The root cause is the missing annotation at netlink_seq_start()
Add the missing  __acquires(RCU) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c

index 813bfab..19df49a 100644 (file)
@@ -2583,6 +2583,7 @@ static void *__netlink_seq_next(struct seq_file *seq)
 }
 
 static void *netlink_seq_start(struct seq_file *seq, loff_t *posp)
+       __acquires(RCU)
 {
        struct nl_seq_iter *iter = seq->private;
        void *obj = SEQ_START_TOKEN;