diff options
| -rw-r--r-- | net/ipv6/anycast.c | 3 | ||||
| -rw-r--r-- | net/ipv6/mcast.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index 2f4f584d796d..757a810d8f15 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
| @@ -189,6 +189,9 @@ void ipv6_sock_ac_close(struct sock *sk) | |||
| 189 | struct net *net = sock_net(sk); | 189 | struct net *net = sock_net(sk); |
| 190 | int prev_index; | 190 | int prev_index; |
| 191 | 191 | ||
| 192 | if (!np->ipv6_ac_list) | ||
| 193 | return; | ||
| 194 | |||
| 192 | write_lock_bh(&ipv6_sk_ac_lock); | 195 | write_lock_bh(&ipv6_sk_ac_lock); |
| 193 | pac = np->ipv6_ac_list; | 196 | pac = np->ipv6_ac_list; |
| 194 | np->ipv6_ac_list = NULL; | 197 | np->ipv6_ac_list = NULL; |
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) | |||
| 284 | struct ipv6_mc_socklist *mc_lst; | 284 | struct ipv6_mc_socklist *mc_lst; |
| 285 | struct net *net = sock_net(sk); | 285 | struct net *net = sock_net(sk); |
| 286 | 286 | ||
| 287 | if (!rcu_access_pointer(np->ipv6_mc_list)) | ||
| 288 | return; | ||
| 289 | |||
| 287 | spin_lock(&ipv6_sk_mc_lock); | 290 | spin_lock(&ipv6_sk_mc_lock); |
| 288 | while ((mc_lst = rcu_dereference_protected(np->ipv6_mc_list, | 291 | while ((mc_lst = rcu_dereference_protected(np->ipv6_mc_list, |
| 289 | lockdep_is_held(&ipv6_sk_mc_lock))) != NULL) { | 292 | lockdep_is_held(&ipv6_sk_mc_lock))) != NULL) { |
