wg: fix MOD_LOAD to fail properly if cookie_init() fails

Previously we'd jump to the `free_crypto` label, but never set `ret` to
a failure value -- it would retain success from the call just prior.

Set ret up properly.

This is part of D40708, but not the main point of the change.
This commit is contained in:
Kyle Evans 2023-06-23 11:41:07 -05:00
parent c3e58ace31
commit ad9f4e6351

View file

@ -2996,7 +2996,8 @@ wg_module_init(void)
ret = crypto_init();
if (ret != 0)
goto free_zone;
if (cookie_init() != 0)
ret = cookie_init();
if (ret != 0)
goto free_crypto;
wg_osd_jail_slot = osd_jail_register(NULL, methods);