aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_tunnel.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2008-12-15 02:13:48 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-15 02:13:48 -0500
commit5ce1bbb97bf1e6707102d30499e7feaa1e6a2134 (patch)
treeea00308023d60ccdbf142e0fab92fe8bfc018934 /net/ipv6/xfrm6_tunnel.c
parent857a6e0a4d8db0bbee685ccc97c6bd7987e7aede (diff)
xfrm6_tunnel: 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/ipv6/xfrm6_tunnel.c')
-rw-r--r--net/ipv6/xfrm6_tunnel.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index c2b278138604..80193db224d9 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -345,24 +345,23 @@ static struct xfrm6_tunnel xfrm46_tunnel_handler = {
345static int __init xfrm6_tunnel_init(void) 345static int __init xfrm6_tunnel_init(void)
346{ 346{
347 if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0) 347 if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0)
348 return -EAGAIN; 348 goto err;
349 349 if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6))
350 if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6)) { 350 goto unreg;
351 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); 351 if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET))
352 return -EAGAIN; 352 goto dereg6;
353 } 353 if (xfrm6_tunnel_spi_init() < 0)
354 if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET)) { 354 goto dereg46;
355 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
356 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
357 return -EAGAIN;
358 }
359 if (xfrm6_tunnel_spi_init() < 0) {
360 xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
361 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
362 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
363 return -EAGAIN;
364 }
365 return 0; 355 return 0;
356
357dereg46:
358 xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
359dereg6:
360 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
361unreg:
362 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
363err:
364 return -EAGAIN;
366} 365}
367 366
368static void __exit xfrm6_tunnel_fini(void) 367static void __exit xfrm6_tunnel_fini(void)