aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2010-01-25 10:28:21 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-08 10:23:17 -0700
commit0515423344552278c1c3c5304515088521c73478 (patch)
tree87b25bac71de1c8c34457d7b3e59ac9fe330ea12
parent7606088a8d06062750d6d24cab6e064d7711356e (diff)
netns xfrm: fixup xfrm6_tunnel error propagation
commit e924960dacdf85d118a98c7262edf2f99c3015cf upstream. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--net/ipv6/xfrm6_tunnel.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index 81a95c00e50..473f8793ea2 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -344,13 +344,19 @@ static struct xfrm6_tunnel xfrm46_tunnel_handler = {
static int __init xfrm6_tunnel_init(void)
{
- if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0)
+ int rv;
+
+ rv = xfrm_register_type(&xfrm6_tunnel_type, AF_INET6);
+ if (rv < 0)
goto err;
- if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6))
+ rv = xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6);
+ if (rv < 0)
goto unreg;
- if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET))
+ rv = xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET);
+ if (rv < 0)
goto dereg6;
- if (xfrm6_tunnel_spi_init() < 0)
+ rv = xfrm6_tunnel_spi_init();
+ if (rv < 0)
goto dereg46;
return 0;
@@ -361,7 +367,7 @@ dereg6:
unreg:
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
err:
- return -EAGAIN;
+ return rv;
}
static void __exit xfrm6_tunnel_fini(void)