diff options
author | 2001-05-16 19:14:03 +0000 | |
---|---|---|
committer | 2001-05-16 19:14:03 +0000 | |
commit | 396a836047ef5ec865836468e8d992bd7660bec7 (patch) | |
tree | 07cf65af54794ba7a8ef2019727218239a600c6c | |
parent | Use PMAP_NEW if UVM is defined. (diff) | |
download | wireguard-openbsd-396a836047ef5ec865836468e8d992bd7660bec7.tar.xz wireguard-openbsd-396a836047ef5ec865836468e8d992bd7660bec7.zip |
call malloc w/ NOWAIT and check for NULL return
-rw-r--r-- | sys/dev/ic/ac97.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ic/ac97.c b/sys/dev/ic/ac97.c index 57e0a4dd01c..d4c0cd06089 100644 --- a/sys/dev/ic/ac97.c +++ b/sys/dev/ic/ac97.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ac97.c,v 1.17 2001/05/16 12:51:48 ho Exp $ */ +/* $OpenBSD: ac97.c,v 1.18 2001/05/16 19:14:03 mickey Exp $ */ /* * Copyright (c) 1999, 2000 Constantine Sapuntzakis @@ -582,7 +582,9 @@ ac97_attach(host_if) mixer_ctrl_t ctl; int error, i; - as = malloc(sizeof(struct ac97_softc), M_DEVBUF, M_WAITOK); + if (!(as = malloc(sizeof(struct ac97_softc), M_DEVBUF, M_NOWAIT))) + return (ENOMEM); + bzero(as, sizeof(*as)); as->codec_if.vtbl = &ac97civ; |