aboutsummaryrefslogtreecommitdiffstats
path: root/src/wg_noise.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-11-10 16:38:22 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2022-06-14 00:54:37 +0200
commitb7441e315429e65c5b60c4ebcf05282a8c53456d (patch)
tree3bea3ea032c9d05e5aed03f2b2459fea79d59534 /src/wg_noise.c
parentbuild: include compat.h for all files (diff)
downloadwireguard-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 'src/wg_noise.c')
-rw-r--r--src/wg_noise.c3
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");