mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
ipv4: add __rcu annotations to ip_ra_chain
Add __rcu annotations to :
(struct ip_ra_chain)->next
struct ip_ra_chain *ip_ra_chain;
And use appropriate rcu primitives.
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
0d7da9ddd9
commit
43a951e999
2 changed files with 9 additions and 5 deletions
|
|
@ -238,7 +238,7 @@ int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc)
|
|||
but receiver should be enough clever f.e. to forward mtrace requests,
|
||||
sent to multicast group to reach destination designated router.
|
||||
*/
|
||||
struct ip_ra_chain *ip_ra_chain;
|
||||
struct ip_ra_chain __rcu *ip_ra_chain;
|
||||
static DEFINE_SPINLOCK(ip_ra_lock);
|
||||
|
||||
|
||||
|
|
@ -253,7 +253,8 @@ static void ip_ra_destroy_rcu(struct rcu_head *head)
|
|||
int ip_ra_control(struct sock *sk, unsigned char on,
|
||||
void (*destructor)(struct sock *))
|
||||
{
|
||||
struct ip_ra_chain *ra, *new_ra, **rap;
|
||||
struct ip_ra_chain *ra, *new_ra;
|
||||
struct ip_ra_chain __rcu **rap;
|
||||
|
||||
if (sk->sk_type != SOCK_RAW || inet_sk(sk)->inet_num == IPPROTO_RAW)
|
||||
return -EINVAL;
|
||||
|
|
@ -261,7 +262,10 @@ int ip_ra_control(struct sock *sk, unsigned char on,
|
|||
new_ra = on ? kmalloc(sizeof(*new_ra), GFP_KERNEL) : NULL;
|
||||
|
||||
spin_lock_bh(&ip_ra_lock);
|
||||
for (rap = &ip_ra_chain; (ra = *rap) != NULL; rap = &ra->next) {
|
||||
for (rap = &ip_ra_chain;
|
||||
(ra = rcu_dereference_protected(*rap,
|
||||
lockdep_is_held(&ip_ra_lock))) != NULL;
|
||||
rap = &ra->next) {
|
||||
if (ra->sk == sk) {
|
||||
if (on) {
|
||||
spin_unlock_bh(&ip_ra_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue