diff options
author | ache <ache@FreeBSD.org> | 1997-12-19 09:48:57 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-12-19 09:48:57 +0000 |
commit | 6c0f717b7e39669dd702fa25ae890b962c770863 (patch) | |
tree | aa69b43439c192d54199850238587dfbb85bc9d7 | |
parent | 6bd1f74dcf56a424893fe1175291006b3107adff (diff) | |
download | FreeBSD-src-6c0f717b7e39669dd702fa25ae890b962c770863.zip FreeBSD-src-6c0f717b7e39669dd702fa25ae890b962c770863.tar.gz |
SUNIT: use MALLOC/FREE and M_NOWAIT
-rw-r--r-- | sys/net/if_sl.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c index 22dde19..bb63ebd 100644 --- a/sys/net/if_sl.c +++ b/sys/net/if_sl.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_sl.c 8.6 (Berkeley) 2/1/94 - * $Id: if_sl.c,v 1.61 1997/10/07 09:13:06 ache Exp $ + * $Id: if_sl.c,v 1.62 1997/12/06 13:24:31 bde Exp $ */ /* @@ -379,14 +379,18 @@ sltioctl(tp, cmd, data, flag, p) if ( nc->sc_if.if_unit == *(u_int *)data && nc->sc_ttyp == NULL ) { - tmpnc = malloc(sizeof *tmpnc, M_TEMP, - M_WAITOK); + MALLOC(tmpnc, sizeof *tmpnc, M_TEMP, + M_NOWAIT); + if (tmpnc == NULL) { + splx(s); + return (ENOMEM); + } *tmpnc = *nc; *nc = *sc; nc->sc_if = tmpnc->sc_if; tmpnc->sc_if = sc->sc_if; *sc = *tmpnc; - free(tmpnc, M_TEMP); + FREE(tmpnc, M_TEMP); if (sc->sc_if.if_flags & IFF_UP) { if_down(&sc->sc_if); if (!(nc->sc_if.if_flags & IFF_UP)) |