Skip to content

Commit

Permalink
raw: Add missing annotations to raw_seq_start() and raw_seq_stop()
Browse files Browse the repository at this point in the history
Sparse reports warnings at raw_seq_start() and raw_seq_stop()

warning: context imbalance in raw_seq_start() - wrong count at exit
warning: context imbalance in raw_seq_stop() - unexpected unlock

The root cause is the missing annotations at raw_seq_start()
	and raw_seq_stop()
Add the missing __acquires(&h->lock) annotation
Add the missing __releases(&h->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jules Irenge authored and David S. Miller committed Mar 12, 2020
1 parent 4cda752 commit 0d8a42c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ipv4/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,7 @@ static struct sock *raw_get_idx(struct seq_file *seq, loff_t pos)
}

void *raw_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(&h->lock)
{
struct raw_hashinfo *h = PDE_DATA(file_inode(seq->file));

Expand All @@ -1056,6 +1057,7 @@ void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos)
EXPORT_SYMBOL_GPL(raw_seq_next);

void raw_seq_stop(struct seq_file *seq, void *v)
__releases(&h->lock)
{
struct raw_hashinfo *h = PDE_DATA(file_inode(seq->file));

Expand Down

0 comments on commit 0d8a42c

Please sign in to comment.