summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-12-08 11:53:50 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-12-09 21:31:11 +0100
commitc2ea3e315e521619758fdaeea4a4912ba719e66b (patch)
treefc4879c2734ca809057a83aa70137ddf39f91155
parent0f94cbadf93b1f16546a7c9667ac222c8fede9b2 (diff)
main: cleaner error teardown
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/main.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/main.c b/src/main.c
index aefc6df..d4231b1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -16,7 +16,7 @@
static int __init mod_init(void)
{
- int ret;
+ int err;
#ifdef DEBUG
if (!routing_table_selftest() ||
@@ -30,32 +30,32 @@ static int __init mod_init(void)
chacha20poly1305_init();
noise_init();
- ret = ratelimiter_module_init();
- if (ret < 0)
- goto out;
+ err = ratelimiter_module_init();
+ if (err < 0)
+ return err;
#ifdef CONFIG_WIREGUARD_PARALLEL
- ret = packet_init_data_caches();
- if (ret < 0)
+ err = packet_init_data_caches();
+ if (err < 0)
goto err_packet;
#endif
- ret = device_init();
- if (ret < 0)
+ err = device_init();
+ if (err < 0)
goto err_device;
pr_info("WireGuard " WIREGUARD_VERSION " loaded. See www.wireguard.io for information.\n");
pr_info("Copyright (C) 2015-2016 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.\n");
- goto out;
+ return 0;
+
err_device:
#ifdef CONFIG_WIREGUARD_PARALLEL
packet_deinit_data_caches();
-#endif
err_packet:
+#endif
ratelimiter_module_deinit();
-out:
- return ret;
+ return err;
}
static void __exit mod_exit(void)