From 630ce3acafb6c26deb5d91610e9d8875a6b6bc61 Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Tue, 9 Jan 2018 15:24:25 +0000 Subject: Creating a cloned interface could return ENOMEM due to temporary memory shortage. As it is invoked from a system call, it should not fail and wait instead. OK visa@ mpi@ --- sys/net/if_pflog.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sys/net/if_pflog.c') diff --git a/sys/net/if_pflog.c b/sys/net/if_pflog.c index 89473110cd0..47783944a27 100644 --- a/sys/net/if_pflog.c +++ b/sys/net/if_pflog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pflog.c,v 1.80 2017/08/11 21:24:19 mpi Exp $ */ +/* $OpenBSD: if_pflog.c,v 1.81 2018/01/09 15:24:24 bluhm Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -137,10 +137,7 @@ pflog_clone_create(struct if_clone *ifc, int unit) struct ifnet *ifp; struct pflog_softc *pflogif; - if ((pflogif = malloc(sizeof(*pflogif), - M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) - return (ENOMEM); - + pflogif = malloc(sizeof(*pflogif), M_DEVBUF, M_WAITOK|M_ZERO); pflogif->sc_unit = unit; ifp = &pflogif->sc_if; snprintf(ifp->if_xname, sizeof ifp->if_xname, "pflog%d", unit); -- cgit v1.2.3