diff options
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r-- | net/ipv6/mcast.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index b19ed51a45bb..28dfa5f3801f 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -284,6 +284,9 @@ void ipv6_sock_mc_close(struct sock *sk) struct ipv6_mc_socklist *mc_lst; struct net *net = sock_net(sk); + if (!rcu_access_pointer(np->ipv6_mc_list)) + return; + spin_lock(&ipv6_sk_mc_lock); while ((mc_lst = rcu_dereference_protected(np->ipv6_mc_list, lockdep_is_held(&ipv6_sk_mc_lock))) != NULL) { |