Skip to content

Commit

Permalink
[NETFILTER]: Supress some sparse warnings
Browse files Browse the repository at this point in the history
  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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 1, 2008
1 parent 3046d76 commit ca7c48c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions net/netfilter/nf_conntrack_expect.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ static struct hlist_node *ct_expect_get_idx(struct seq_file *seq, loff_t pos)
}

static void *exp_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(nf_conntrack_lock)
{
read_lock_bh(&nf_conntrack_lock);
return ct_expect_get_idx(seq, *pos);
Expand All @@ -439,6 +440,7 @@ static void *exp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
}

static void exp_seq_stop(struct seq_file *seq, void *v)
__releases(nf_conntrack_lock)
{
read_unlock_bh(&nf_conntrack_lock);
}
Expand Down
2 changes: 2 additions & 0 deletions net/netfilter/nf_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ EXPORT_SYMBOL(nf_log_packet);

#ifdef CONFIG_PROC_FS
static void *seq_start(struct seq_file *seq, loff_t *pos)
__acquires(RCU)
{
rcu_read_lock();

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

static void seq_stop(struct seq_file *s, void *v)
__releases(RCU)
{
rcu_read_unlock();
}
Expand Down
6 changes: 4 additions & 2 deletions net/netfilter/nfnetlink_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,

if (data_len) {
struct nlattr *nla;
int size = nla_attr_size(data_len);
int sz = nla_attr_size(data_len);

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

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

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

static void *seq_start(struct seq_file *seq, loff_t *pos)
__acquires(instances_lock)
{
spin_lock(&instances_lock);
return get_idx(seq, *pos);
Expand All @@ -857,6 +858,7 @@ static void *seq_next(struct seq_file *s, void *v, loff_t *pos)
}

static void seq_stop(struct seq_file *s, void *v)
__releases(instances_lock)
{
spin_unlock(&instances_lock);
}
Expand Down

0 comments on commit ca7c48c

Please sign in to comment.