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_mpe.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_mpe.c')
-rw-r--r-- | sys/net/if_mpe.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index 28cf41e99bb..e15c821bb00 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpe.c,v 1.63 2017/11/29 19:36:03 claudio Exp $ */ +/* $OpenBSD: if_mpe.c,v 1.64 2018/01/09 15:24:24 bluhm Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -81,10 +81,7 @@ mpe_clone_create(struct if_clone *ifc, int unit) struct ifnet *ifp; struct mpe_softc *mpeif; - if ((mpeif = malloc(sizeof(*mpeif), - M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) - return (ENOMEM); - + mpeif = malloc(sizeof(*mpeif), M_DEVBUF, M_WAITOK|M_ZERO); mpeif->sc_unit = unit; ifp = &mpeif->sc_if; snprintf(ifp->if_xname, sizeof ifp->if_xname, "mpe%d", unit); |