From 927257312b71f06261d454cca508577c2a0afaa0 Mon Sep 17 00:00:00 2001 From: Niels Werensteijn Date: Tue, 11 Oct 2016 11:20:13 +0200 Subject: [PATCH] uninitialize matches if targets fail to register --- src/ts3init_module.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ts3init_module.c b/src/ts3init_module.c index ba008a8..60378f4 100644 --- a/src/ts3init_module.c +++ b/src/ts3init_module.c @@ -36,15 +36,19 @@ static int __init ts3init_init(void) int error; error = ts3init_match_init(); if (error) - return error; + return error; + error = ts3init_target_init(); + if (error) + ts3init_match_exit(); + return error; } static void __exit ts3init_exit(void) { ts3init_match_exit(); - ts3init_target_exit(); + ts3init_target_exit(); } module_init(ts3init_init);