Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init: Fix deinit crash #162

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions src/kovid.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,10 @@ static int __init kv_init(void) {
cont:
#endif
/** Init crypto engine */
kv_crypto_key_init();
if (kv_crypto_key_init() < 0) {
prerr("Failed to initialise crypto engine\n");
goto crypto_error;
}


tsk_sniff = kv_sock_start_sniff();
Expand Down Expand Up @@ -840,20 +843,24 @@ static int __init kv_init(void) {

unroll_init:
prerr("Could not load basic functionality.\n");
_unroll_init();
rv = -EFAULT;
goto leave;
goto error;
addr_error:
prerr("Could not get kernel function address, proc file not created.\n");
rv = -EFAULT;
goto leave;
goto error;
sys_init_error:
prerr("Could not load syscalls hooks\n");
rv = -EFAULT;
goto leave;
goto error;
procname_missing:
prerr("%s\n", procname_err);
goto error;
crypto_error:
prerr("Crypto init error\n");

error:
prerr("Unrolling\n");
_unroll_init();
rv = -EFAULT;

leave:
return rv;
}
Expand Down
Loading