提交 448eb71f 编写于 作者: I Ilpo Järvinen 提交者: David S. Miller

ipv6/mcast: join error paths using goto

Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5ce1bbb9
...@@ -303,20 +303,23 @@ static struct inet6_dev *ip6_mc_find_dev(struct net *net, ...@@ -303,20 +303,23 @@ static struct inet6_dev *ip6_mc_find_dev(struct net *net,
dev = dev_get_by_index(net, ifindex); dev = dev_get_by_index(net, ifindex);
if (!dev) if (!dev)
return NULL; goto nodev;
idev = in6_dev_get(dev); idev = in6_dev_get(dev);
if (!idev) { if (!idev)
dev_put(dev); goto release;
return NULL;
}
read_lock_bh(&idev->lock); read_lock_bh(&idev->lock);
if (idev->dead) { if (idev->dead)
goto unlock_release;
return idev;
unlock_release:
read_unlock_bh(&idev->lock); read_unlock_bh(&idev->lock);
in6_dev_put(idev); in6_dev_put(idev);
release:
dev_put(dev); dev_put(dev);
nodev:
return NULL; return NULL;
}
return idev;
} }
void ipv6_sock_mc_close(struct sock *sk) void ipv6_sock_mc_close(struct sock *sk)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册