git: ea2a3ed3bcf7 - stable/13 - wg: fix MOD_LOAD to fail properly if cookie_init() fails
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 12 Jul 2023 03:10:54 UTC
The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ea2a3ed3bcf7e792ba0c0625602ada29424c337c commit ea2a3ed3bcf7e792ba0c0625602ada29424c337c Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2023-06-23 16:41:07 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-07-11 15:05:38 +0000 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. (cherry picked from commit ad9f4e6351fb23ee81bc940638d20af3ca7c278d) --- 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 9c4ebe5dd393..8ba1d229da4f 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2998,7 +2998,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);