From: Ilpo Järvinen Date: Mon, 15 Dec 2008 07:15:21 +0000 (-0800) Subject: ipv6/mcast: join error paths using goto X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=448eb71f40120a8fd11ebd58153c271c63e6f862;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git ipv6/mcast: join error paths using goto Signed-off-by: Ilpo Järvinen Signed-off-by: David S. Miller --- diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 0f389603283..a51fb33e686 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, dev = dev_get_by_index(net, ifindex); if (!dev) - return NULL; + goto nodev; idev = in6_dev_get(dev); - if (!idev) { - dev_put(dev); - return NULL; - } + if (!idev) + goto release; read_lock_bh(&idev->lock); - if (idev->dead) { - read_unlock_bh(&idev->lock); - in6_dev_put(idev); - dev_put(dev); - return NULL; - } + if (idev->dead) + goto unlock_release; + return idev; + +unlock_release: + read_unlock_bh(&idev->lock); + in6_dev_put(idev); +release: + dev_put(dev); +nodev: + return NULL; } void ipv6_sock_mc_close(struct sock *sk)