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_mpe.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sys/net/if_mpe.c') 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 @@ -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); -- cgit v1.2.3