From e8d9d54999bddb689059f3aa918a94f10b224b55 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 19 Mar 2021 13:08:42 -0600 Subject: if_wg: do not check for null M_NOWAIT return Reported-by: Kyle Evans Signed-off-by: Jason A. Donenfeld --- src/if_wg.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/if_wg.c b/src/if_wg.c index f14c540..d589842 100644 --- a/src/if_wg.c +++ b/src/if_wg.c @@ -2906,15 +2906,7 @@ wg_marshal_peers(struct wg_softc *sc, nvlist_t **nvlp, nvlist_t ***nvl_arrayp, i err = i = 0; nvl_array = mallocarray(peer_count, sizeof(void *), M_TEMP, M_WAITOK | M_ZERO); - if (!nvl_array) { - err = ENOMEM; - goto out; - } wpe = mallocarray(peer_count, sizeof(*wpe), M_TEMP, M_WAITOK | M_ZERO); - if (!wpe) { - err = ENOMEM; - goto out; - } NET_EPOCH_ENTER(et); CK_LIST_FOREACH(peer, &sc->sc_hashtable.h_peers_list, p_entry) { -- cgit v1.2.3-59-g8ed1b