Skip to content

Commit 10d50e7

Browse files
Lai Jiangshanpaulmck
authored andcommitted
net,rcu: convert call_rcu(ip_mc_socklist_reclaim) to kfree_rcu()
The rcu callback ip_mc_socklist_reclaim() just calls a kfree(), so we use kfree_rcu() instead of the call_rcu(ip_mc_socklist_reclaim). Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
1 parent 7519cce commit 10d50e7

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

‎net/ipv4/igmp.c‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,14 +1850,6 @@ static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
18501850
return err;
18511851
}
18521852

1853-
1854-
static void ip_mc_socklist_reclaim(struct rcu_head *rp)
1855-
{
1856-
kfree(container_of(rp, struct ip_mc_socklist, rcu));
1857-
/* sk_omem_alloc should have been decreased by the caller*/
1858-
}
1859-
1860-
18611853
/*
18621854
* Ask a socket to leave a group.
18631855
*/
@@ -1897,7 +1889,7 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
18971889
rtnl_unlock();
18981890
/* decrease mem now to avoid the memleak warning */
18991891
atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
1900-
call_rcu(&iml->rcu, ip_mc_socklist_reclaim);
1892+
kfree_rcu(iml, rcu);
19011893
return 0;
19021894
}
19031895
if (!in_dev)
@@ -2312,7 +2304,7 @@ void ip_mc_drop_socket(struct sock *sk)
23122304
ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr);
23132305
/* decrease mem now to avoid the memleak warning */
23142306
atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
2315-
call_rcu(&iml->rcu, ip_mc_socklist_reclaim);
2307+
kfree_rcu(iml, rcu);
23162308
}
23172309
rtnl_unlock();
23182310
}

0 commit comments

Comments
 (0)