diff options
author | John Baldwin <jhb@FreeBSD.org> | 2021-11-10 16:38:22 -0800 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-06-14 00:54:37 +0200 |
commit | b7441e315429e65c5b60c4ebcf05282a8c53456d (patch) | |
tree | 3bea3ea032c9d05e5aed03f2b2459fea79d59534 /src/wg_noise.c | |
parent | build: include compat.h for all files (diff) | |
download | wireguard-freebsd-b7441e315429e65c5b60c4ebcf05282a8c53456d.tar.xz wireguard-freebsd-b7441e315429e65c5b60c4ebcf05282a8c53456d.zip |
if_wg: wg_peer_alloc and wg_aip_add: Use M_WAITOK with malloc
Signed-off-by: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to '')
-rw-r--r-- | src/wg_noise.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/wg_noise.c b/src/wg_noise.c index d166543..8da001f 100644 --- a/src/wg_noise.c +++ b/src/wg_noise.c @@ -295,8 +295,7 @@ noise_remote_alloc(struct noise_local *l, void *arg, { struct noise_remote *r; - if ((r = malloc(sizeof(*r), M_NOISE, M_NOWAIT | M_ZERO)) == NULL) - return (NULL); + r = malloc(sizeof(*r), M_NOISE, M_WAITOK | M_ZERO); memcpy(r->r_public, public, NOISE_PUBLIC_KEY_LEN); rw_init(&r->r_handshake_lock, "noise_handshake"); |