Commit 5ce1bbb9 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by David S. Miller

xfrm6_tunnel: join error paths using goto

Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 857a6e0a
...@@ -345,24 +345,23 @@ static struct xfrm6_tunnel xfrm46_tunnel_handler = { ...@@ -345,24 +345,23 @@ static struct xfrm6_tunnel xfrm46_tunnel_handler = {
static int __init xfrm6_tunnel_init(void) static int __init xfrm6_tunnel_init(void)
{ {
if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0) if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0)
return -EAGAIN; goto err;
if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6))
if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6)) { goto unreg;
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET))
return -EAGAIN; goto dereg6;
} if (xfrm6_tunnel_spi_init() < 0)
if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET)) { goto dereg46;
xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
return -EAGAIN;
}
if (xfrm6_tunnel_spi_init() < 0) {
xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
return -EAGAIN;
}
return 0; return 0;
dereg46:
xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
dereg6:
xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
unreg:
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
err:
return -EAGAIN;
} }
static void __exit xfrm6_tunnel_fini(void) static void __exit xfrm6_tunnel_fini(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment