diff options
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r-- | net/ipv6/mcast.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 0f3896032830..a51fb33e6864 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -303,20 +303,23 @@ static struct inet6_dev *ip6_mc_find_dev(struct net *net, | |||
303 | dev = dev_get_by_index(net, ifindex); | 303 | dev = dev_get_by_index(net, ifindex); |
304 | 304 | ||
305 | if (!dev) | 305 | if (!dev) |
306 | return NULL; | 306 | goto nodev; |
307 | idev = in6_dev_get(dev); | 307 | idev = in6_dev_get(dev); |
308 | if (!idev) { | 308 | if (!idev) |
309 | dev_put(dev); | 309 | goto release; |
310 | return NULL; | ||
311 | } | ||
312 | read_lock_bh(&idev->lock); | 310 | read_lock_bh(&idev->lock); |
313 | if (idev->dead) { | 311 | if (idev->dead) |
314 | read_unlock_bh(&idev->lock); | 312 | goto unlock_release; |
315 | in6_dev_put(idev); | 313 | |
316 | dev_put(dev); | ||
317 | return NULL; | ||
318 | } | ||
319 | return idev; | 314 | return idev; |
315 | |||
316 | unlock_release: | ||
317 | read_unlock_bh(&idev->lock); | ||
318 | in6_dev_put(idev); | ||
319 | release: | ||
320 | dev_put(dev); | ||
321 | nodev: | ||
322 | return NULL; | ||
320 | } | 323 | } |
321 | 324 | ||
322 | void ipv6_sock_mc_close(struct sock *sk) | 325 | void ipv6_sock_mc_close(struct sock *sk) |