Commit 18943d29 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

inet: fix ip_mc_drop_socket()

commit 8723e1b4 (inet: RCU changes in inetdev_by_index())
forgot one call site in ip_mc_drop_socket()

We should not decrease idev refcount after inetdev_by_index() call,
since refcount is not increased anymore.
Reported-by: default avatarMarkus Trippelsdorf <markus@trippelsdorf.de>
Reported-by: default avatarMiles Lane <miles.lane@gmail.com>
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aa58163a
...@@ -2306,10 +2306,8 @@ void ip_mc_drop_socket(struct sock *sk) ...@@ -2306,10 +2306,8 @@ void ip_mc_drop_socket(struct sock *sk)
in_dev = inetdev_by_index(net, iml->multi.imr_ifindex); in_dev = inetdev_by_index(net, iml->multi.imr_ifindex);
(void) ip_mc_leave_src(sk, iml, in_dev); (void) ip_mc_leave_src(sk, iml, in_dev);
if (in_dev != NULL) { if (in_dev != NULL)
ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr); ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr);
in_dev_put(in_dev);
}
/* decrease mem now to avoid the memleak warning */ /* decrease mem now to avoid the memleak warning */
atomic_sub(sizeof(*iml), &sk->sk_omem_alloc); atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
call_rcu(&iml->rcu, ip_mc_socklist_reclaim); call_rcu(&iml->rcu, ip_mc_socklist_reclaim);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment