summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-05-24 04:09:48 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-05-24 04:09:48 +0000
commit7450dd3acf0959241423a6882f3f85c7442f4203 (patch)
tree23359308cb3fe3afe41a6bbb11641b9d7b94de25 /sys/dev
parent4096d0365c682750bd4db5b8596a600185c38d1d (diff)
Check malloc() returns, from tedu@heorot.stanford.edu, ok aaron@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pcmcia/pcmcia_cis_quirks.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/pcmcia/pcmcia_cis_quirks.c b/sys/dev/pcmcia/pcmcia_cis_quirks.c
index 96ebcaeafdf..f6194d248c2 100644
--- a/sys/dev/pcmcia/pcmcia_cis_quirks.c
+++ b/sys/dev/pcmcia/pcmcia_cis_quirks.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmcia_cis_quirks.c,v 1.4 2000/06/20 05:01:11 niklas Exp $ */
+/* $OpenBSD: pcmcia_cis_quirks.c,v 1.5 2001/05/24 04:09:47 angelos Exp $ */
/* $NetBSD: pcmcia_cis_quirks.c,v 1.3 1998/12/29 09:00:28 marc Exp $ */
/*
@@ -232,15 +232,21 @@ void pcmcia_check_cis_quirks(sc)
if (pf_last == pcmcia_cis_quirks[i].pf) {
cfe = malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT);
+ if (cfe == NULL)
+ return;
*cfe = *pcmcia_cis_quirks[i].cfe;
SIMPLEQ_INSERT_TAIL(&pf->cfe_head, cfe, cfe_list);
} else {
pf = malloc(sizeof(*pf), M_DEVBUF, M_NOWAIT);
+ if (pf == NULL)
+ return;
*pf = *pcmcia_cis_quirks[i].pf;
SIMPLEQ_INIT(&pf->cfe_head);
cfe = malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT);
+ if (cfe == NULL)
+ return;
*cfe = *pcmcia_cis_quirks[i].cfe;
SIMPLEQ_INSERT_TAIL(&pf->cfe_head, cfe, cfe_list);