summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2008-12-15 10:15:21 +0300
committerDavid S. Miller <davem@davemloft.net>2008-12-15 10:15:21 +0300
commit448eb71f40120a8fd11ebd58153c271c63e6f862 (patch)
treea053aac189359d93c8ec32ba0a2d876e71863342 /net
parent5ce1bbb97bf1e6707102d30499e7feaa1e6a2134 (diff)
downloadlinux-448eb71f40120a8fd11ebd58153c271c63e6f862.tar.xz
ipv6/mcast: join error paths using goto
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/mcast.c25
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,
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)