Skip to content

Commit ca7c48c

Browse files
Eric Dumazetdavem330
authored andcommitted
[NETFILTER]: Supress some sparse warnings
CHECK net/netfilter/nf_conntrack_expect.c net/netfilter/nf_conntrack_expect.c:429:13: warning: context imbalance in 'exp_seq_start' - wrong count at exit net/netfilter/nf_conntrack_expect.c:441:13: warning: context imbalance in 'exp_seq_stop' - unexpected unlock CHECK net/netfilter/nf_log.c net/netfilter/nf_log.c:105:13: warning: context imbalance in 'seq_start' - wrong count at exit net/netfilter/nf_log.c:125:13: warning: context imbalance in 'seq_stop' - unexpected unlock CHECK net/netfilter/nfnetlink_queue.c net/netfilter/nfnetlink_queue.c:363:7: warning: symbol 'size' shadows an earlier one net/netfilter/nfnetlink_queue.c:217:9: originally declared here net/netfilter/nfnetlink_queue.c:847:13: warning: context imbalance in 'seq_start' - wrong count at exit net/netfilter/nfnetlink_queue.c:859:13: warning: context imbalance in 'seq_stop' - unexpected unlock Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3046d76 commit ca7c48c

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎net/netfilter/nf_conntrack_expect.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ static struct hlist_node *ct_expect_get_idx(struct seq_file *seq, loff_t pos)
427427
}
428428

429429
static void *exp_seq_start(struct seq_file *seq, loff_t *pos)
430+
__acquires(nf_conntrack_lock)
430431
{
431432
read_lock_bh(&nf_conntrack_lock);
432433
return ct_expect_get_idx(seq, *pos);
@@ -439,6 +440,7 @@ static void *exp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
439440
}
440441

441442
static void exp_seq_stop(struct seq_file *seq, void *v)
443+
__releases(nf_conntrack_lock)
442444
{
443445
read_unlock_bh(&nf_conntrack_lock);
444446
}

‎net/netfilter/nf_log.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ EXPORT_SYMBOL(nf_log_packet);
103103

104104
#ifdef CONFIG_PROC_FS
105105
static void *seq_start(struct seq_file *seq, loff_t *pos)
106+
__acquires(RCU)
106107
{
107108
rcu_read_lock();
108109

@@ -123,6 +124,7 @@ static void *seq_next(struct seq_file *s, void *v, loff_t *pos)
123124
}
124125

125126
static void seq_stop(struct seq_file *s, void *v)
127+
__releases(RCU)
126128
{
127129
rcu_read_unlock();
128130
}

‎net/netfilter/nfnetlink_queue.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
360360

361361
if (data_len) {
362362
struct nlattr *nla;
363-
int size = nla_attr_size(data_len);
363+
int sz = nla_attr_size(data_len);
364364

365365
if (skb_tailroom(skb) < nla_total_size(data_len)) {
366366
printk(KERN_WARNING "nf_queue: no tailroom!\n");
@@ -369,7 +369,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
369369

370370
nla = (struct nlattr *)skb_put(skb, nla_total_size(data_len));
371371
nla->nla_type = NFQA_PAYLOAD;
372-
nla->nla_len = size;
372+
nla->nla_len = sz;
373373

374374
if (skb_copy_bits(entskb, 0, nla_data(nla), data_len))
375375
BUG();
@@ -845,6 +845,7 @@ static struct hlist_node *get_idx(struct seq_file *seq, loff_t pos)
845845
}
846846

847847
static void *seq_start(struct seq_file *seq, loff_t *pos)
848+
__acquires(instances_lock)
848849
{
849850
spin_lock(&instances_lock);
850851
return get_idx(seq, *pos);
@@ -857,6 +858,7 @@ static void *seq_next(struct seq_file *s, void *v, loff_t *pos)
857858
}
858859

859860
static void seq_stop(struct seq_file *s, void *v)
861+
__releases(instances_lock)
860862
{
861863
spin_unlock(&instances_lock);
862864
}

0 commit comments

Comments
 (0)