diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2018-01-09 15:24:25 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2018-01-09 15:24:25 +0000 |
commit | 630ce3acafb6c26deb5d91610e9d8875a6b6bc61 (patch) | |
tree | f8c88944a39775dc96058c94e316bc99c8dca96d /sys/net/if_pflog.c | |
parent | b6ab100d040502e7a25daea02f44fa22cc465cbe (diff) |
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@
Diffstat (limited to 'sys/net/if_pflog.c')
-rw-r--r-- | sys/net/if_pflog.c | 7 |
1 files changed, 2 insertions, 5 deletions
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); |