aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-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 438831d33593..23fb1002124c 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -353,13 +353,19 @@ static struct xfrm6_tunnel xfrm46_tunnel_handler = {
353 353
354static int __init xfrm6_tunnel_init(void) 354static int __init xfrm6_tunnel_init(void)
355{ 355{
356 if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0) 356 int rv;
357
358 rv = xfrm_register_type(&xfrm6_tunnel_type, AF_INET6);
359 if (rv < 0)
357 goto err; 360 goto err;
358 if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6)) 361 rv = xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6);
362 if (rv < 0)
359 goto unreg; 363 goto unreg;
360 if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET)) 364 rv = xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET);
365 if (rv < 0)
361 goto dereg6; 366 goto dereg6;
362 if (xfrm6_tunnel_spi_init() < 0) 367 rv = xfrm6_tunnel_spi_init();
368 if (rv < 0)
363 goto dereg46; 369 goto dereg46;
364 return 0; 370 return 0;
365 371
@@ -370,7 +376,7 @@ dereg6:
370unreg: 376unreg:
371 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); 377 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
372err: 378err:
373 return -EAGAIN; 379 return rv;
374} 380}
375 381
376static void __exit xfrm6_tunnel_fini(void) 382static void __exit xfrm6_tunnel_fini(void)