ipv4: Remove redundant RCU locking in ip_check_mc().
All callers are under rcu_read_lock() protection already. Rename to ip_check_mc_rcu() to make it even more clear. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -2333,13 +2333,13 @@ void ip_mc_drop_socket(struct sock *sk)
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
||||
int ip_check_mc(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 proto)
|
||||
/* called with rcu_read_lock() */
|
||||
int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 proto)
|
||||
{
|
||||
struct ip_mc_list *im;
|
||||
struct ip_sf_list *psf;
|
||||
int rv = 0;
|
||||
|
||||
rcu_read_lock();
|
||||
for_each_pmc_rcu(in_dev, im) {
|
||||
if (im->multiaddr == mc_addr)
|
||||
break;
|
||||
@@ -2361,7 +2361,6 @@ int ip_check_mc(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 p
|
||||
} else
|
||||
rv = 1; /* unspecified source; tentatively allow */
|
||||
}
|
||||
rcu_read_unlock();
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user