summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/zs.c
diff options
context:
space:
mode:
authorThomas Nordin <nordin@cvs.openbsd.org>2002-01-10 00:06:18 +0000
committerThomas Nordin <nordin@cvs.openbsd.org>2002-01-10 00:06:18 +0000
commit634288c6fb708ac6b61b1742cec21ebc586cf1b2 (patch)
tree6f1fbc7a160b5deffed691801d3e7a0b26c94745 /sys/arch/sparc/dev/zs.c
parenta2ee845853e11a79fdd1e3ea97c337cfd23b0073 (diff)
Check result from malloc(9) when using M_NOWAIT. jason@ ok
Diffstat (limited to 'sys/arch/sparc/dev/zs.c')
-rw-r--r--sys/arch/sparc/dev/zs.c6
1 files changed, 5 insertions, 1 deletions
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