diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2010-01-25 05:28:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-28 09:31:05 -0500 |
commit | e924960dacdf85d118a98c7262edf2f99c3015cf (patch) | |
tree | a11378743ad6c653989f686722a3fc829e2a4c66 | |
parent | ce96bc86bf2ee12e8a3bf461ca8027557c1ef42f (diff) |
netns xfrm: fixup xfrm6_tunnel error propagation
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv6/xfrm6_tunnel.c | 16 |
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 | ||
354 | static int __init xfrm6_tunnel_init(void) | 354 | static 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: | |||
370 | unreg: | 376 | unreg: |
371 | xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); | 377 | xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); |
372 | err: | 378 | err: |
373 | return -EAGAIN; | 379 | return rv; |
374 | } | 380 | } |
375 | 381 | ||
376 | static void __exit xfrm6_tunnel_fini(void) | 382 | static void __exit xfrm6_tunnel_fini(void) |