Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a429c49 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

[NET]: Add some acquires/releases sparse annotations.



Add __acquires() and __releases() annotations to suppress some sparse
warnings.

example of warnings :

net/ipv4/udp.c:1555:14: warning: context imbalance in 'udp_seq_start' - wrong
count at exit
net/ipv4/udp.c:1571:13: warning: context imbalance in 'udp_seq_stop' -
unexpected unlock

Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b950dfcf
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -2368,6 +2368,7 @@ static int dev_ifconf(struct net *net, char __user *arg)
 *	in detail.
 *	in detail.
 */
 */
void *dev_seq_start(struct seq_file *seq, loff_t *pos)
void *dev_seq_start(struct seq_file *seq, loff_t *pos)
	__acquires(dev_base_lock)
{
{
	struct net *net = seq_file_net(seq);
	struct net *net = seq_file_net(seq);
	loff_t off;
	loff_t off;
@@ -2394,6 +2395,7 @@ void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
}
}


void dev_seq_stop(struct seq_file *seq, void *v)
void dev_seq_stop(struct seq_file *seq, void *v)
	__releases(dev_base_lock)
{
{
	read_unlock(&dev_base_lock);
	read_unlock(&dev_base_lock);
}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -186,6 +186,7 @@ EXPORT_SYMBOL(dev_mc_unsync);


#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos)
static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos)
	__acquires(dev_base_lock)
{
{
	struct net *net = seq_file_net(seq);
	struct net *net = seq_file_net(seq);
	struct net_device *dev;
	struct net_device *dev;
@@ -206,6 +207,7 @@ static void *dev_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
}
}


static void dev_mc_seq_stop(struct seq_file *seq, void *v)
static void dev_mc_seq_stop(struct seq_file *seq, void *v)
	__releases(dev_base_lock)
{
{
	read_unlock(&dev_base_lock);
	read_unlock(&dev_base_lock);
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -55,6 +55,7 @@ gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size)
int
int
gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type,
gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type,
	int xstats_type, spinlock_t *lock, struct gnet_dump *d)
	int xstats_type, spinlock_t *lock, struct gnet_dump *d)
	__acquires(lock)
{
{
	memset(d, 0, sizeof(*d));
	memset(d, 0, sizeof(*d));


+2 −0
Original line number Original line Diff line number Diff line
@@ -2313,6 +2313,7 @@ static void *neigh_get_idx_any(struct seq_file *seq, loff_t *pos)
}
}


void *neigh_seq_start(struct seq_file *seq, loff_t *pos, struct neigh_table *tbl, unsigned int neigh_seq_flags)
void *neigh_seq_start(struct seq_file *seq, loff_t *pos, struct neigh_table *tbl, unsigned int neigh_seq_flags)
	__acquires(tbl->lock)
{
{
	struct neigh_seq_state *state = seq->private;
	struct neigh_seq_state *state = seq->private;
	loff_t pos_minus_one;
	loff_t pos_minus_one;
@@ -2356,6 +2357,7 @@ void *neigh_seq_next(struct seq_file *seq, void *v, loff_t *pos)
EXPORT_SYMBOL(neigh_seq_next);
EXPORT_SYMBOL(neigh_seq_next);


void neigh_seq_stop(struct seq_file *seq, void *v)
void neigh_seq_stop(struct seq_file *seq, void *v)
	__releases(tbl->lock)
{
{
	struct neigh_seq_state *state = seq->private;
	struct neigh_seq_state *state = seq->private;
	struct neigh_table *tbl = state->tbl;
	struct neigh_table *tbl = state->tbl;
+2 −0
Original line number Original line Diff line number Diff line
@@ -2025,6 +2025,7 @@ EXPORT_SYMBOL(proto_unregister);


#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
static void *proto_seq_start(struct seq_file *seq, loff_t *pos)
static void *proto_seq_start(struct seq_file *seq, loff_t *pos)
	__acquires(proto_list_lock)
{
{
	read_lock(&proto_list_lock);
	read_lock(&proto_list_lock);
	return seq_list_start_head(&proto_list, *pos);
	return seq_list_start_head(&proto_list, *pos);
@@ -2036,6 +2037,7 @@ static void *proto_seq_next(struct seq_file *seq, void *v, loff_t *pos)
}
}


static void proto_seq_stop(struct seq_file *seq, void *v)
static void proto_seq_stop(struct seq_file *seq, void *v)
	__releases(proto_list_lock)
{
{
	read_unlock(&proto_list_lock);
	read_unlock(&proto_list_lock);
}
}
Loading