netfilter: ctnetlink: Add missing annotation for ctnetlink_parse_nat_setup()
authorJules Irenge <jbi.octave@gmail.com>
Wed, 11 Mar 2020 01:09:04 +0000 (01:09 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 27 Mar 2020 17:21:09 +0000 (18:21 +0100)
Sparse reports a warning at ctnetlink_parse_nat_setup()

warning: context imbalance in ctnetlink_parse_nat_setup()
- unexpected unlock

The root cause is the missing annotation at ctnetlink_parse_nat_setup()
Add the missing __must_hold(RCU) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_netlink.c

index 6a1c8f1..eb19020 100644 (file)
@@ -1533,6 +1533,7 @@ static int
 ctnetlink_parse_nat_setup(struct nf_conn *ct,
                          enum nf_nat_manip_type manip,
                          const struct nlattr *attr)
+       __must_hold(RCU)
 {
        struct nf_nat_hook *nat_hook;
        int err;