diff options
author | Thomas Nordin <nordin@cvs.openbsd.org> | 2002-01-10 00:06:18 +0000 |
---|---|---|
committer | Thomas Nordin <nordin@cvs.openbsd.org> | 2002-01-10 00:06:18 +0000 |
commit | 634288c6fb708ac6b61b1742cec21ebc586cf1b2 (patch) | |
tree | 6f1fbc7a160b5deffed691801d3e7a0b26c94745 /sys/arch/sparc/dev | |
parent | a2ee845853e11a79fdd1e3ea97c337cfd23b0073 (diff) |
Check result from malloc(9) when using M_NOWAIT. jason@ ok
Diffstat (limited to 'sys/arch/sparc/dev')
-rw-r--r-- | sys/arch/sparc/dev/obio.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc/dev/zs.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/arch/sparc/dev/obio.c b/sys/arch/sparc/dev/obio.c index 5b0b22b5687..95d5f1d1abd 100644 --- a/sys/arch/sparc/dev/obio.c +++ b/sys/arch/sparc/dev/obio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: obio.c,v 1.10 2001/12/08 02:24:07 art Exp $ */ +/* $OpenBSD: obio.c,v 1.11 2002/01/10 00:06:17 nordin Exp $ */ /* $NetBSD: obio.c,v 1.37 1997/07/29 09:58:11 fair Exp $ */ /* @@ -302,6 +302,8 @@ vmesattach(parent, self, args) if (vmeints == NULL) { vmeints = (struct intrhand **)malloc(256 * sizeof(struct intrhand *), M_TEMP, M_NOWAIT); + if (vmeints == NULL) + panic("vmesattach: can't allocate intrhand"); bzero(vmeints, 256 * sizeof(struct intrhand *)); } (void)config_search(vmes_scan, self, args); @@ -323,6 +325,8 @@ vmelattach(parent, self, args) if (vmeints == NULL) { vmeints = (struct intrhand **)malloc(256 * sizeof(struct intrhand *), M_TEMP, M_NOWAIT); + if (vmeints == NULL) + panic("vmelattach: can't allocate intrhand"); bzero(vmeints, 256 * sizeof(struct intrhand *)); } (void)config_search(vmel_scan, self, args); diff --git a/sys/arch/sparc/dev/zs.c b/sys/arch/sparc/dev/zs.c index d5fd19bb5b7..20d19d6c7d0 100644 --- a/sys/arch/sparc/dev/zs.c +++ b/sys/arch/sparc/dev/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.29 2001/10/05 21:13:51 jason Exp $ */ +/* $OpenBSD: zs.c,v 1.30 2002/01/10 00:06:17 nordin Exp $ */ /* $NetBSD: zs.c,v 1.49 1997/08/31 21:26:37 pk Exp $ */ /* @@ -353,6 +353,8 @@ zsattach(parent, dev, aux) cs->cs_ringmask = ringsize - 1; cs->cs_rbuf = malloc((u_long)ringsize * sizeof(*cs->cs_rbuf), M_DEVBUF, M_NOWAIT); + if (cs->cs_rbuf == NULL) + panic("zsattach"); unit++; cs++; @@ -390,6 +392,8 @@ zsattach(parent, dev, aux) cs->cs_ringmask = ringsize - 1; cs->cs_rbuf = malloc((u_long)ringsize * sizeof(*cs->cs_rbuf), M_DEVBUF, M_NOWAIT); + if (cs->cs_rbuf == NULL) + panic("zsattach"); } #ifdef KGDB |