if_wg: wg_module_init: clean up more if the self tests fail

Signed-off-by: John Baldwin <jhb@FreeBSD.org>
This commit is contained in:
John Baldwin 2021-11-22 10:48:59 -08:00 committed by Jason A. Donenfeld
parent ddc22dade9
commit 7658a19cb6
1 changed files with 4 additions and 1 deletions

View File

@ -3007,10 +3007,13 @@ wg_module_init(void)
ret = ENOTRECOVERABLE;
if (!wg_run_selftests())
goto free_zone;
goto free_all;
return (0);
free_all:
osd_jail_deregister(wg_osd_jail_slot);
cookie_deinit();
free_zone:
uma_zdestroy(wg_packet_zone);
free_none: