From ad9f4e6351fb23ee81bc940638d20af3ca7c278d Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Fri, 23 Jun 2023 11:41:07 -0500 Subject: [PATCH] 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. --- sys/dev/wg/if_wg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index d2403792cec..77aed2621c9 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -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);