summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/dev
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/sparc64/dev
parenta2ee845853e11a79fdd1e3ea97c337cfd23b0073 (diff)
Check result from malloc(9) when using M_NOWAIT. jason@ ok
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r--sys/arch/sparc64/dev/psycho.c4
-rw-r--r--sys/arch/sparc64/dev/sbus.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c
index 9436f9c63c1..f0f26564359 100644
--- a/sys/arch/sparc64/dev/psycho.c
+++ b/sys/arch/sparc64/dev/psycho.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: psycho.c,v 1.9 2001/12/14 14:55:57 jason Exp $ */
+/* $OpenBSD: psycho.c,v 1.10 2002/01/10 00:06:17 nordin Exp $ */
/* $NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $ */
/*
@@ -522,6 +522,8 @@ psycho_set_intr(sc, ipl, handler, mapper, clearer)
ih = (struct intrhand *)malloc(sizeof(struct intrhand),
M_DEVBUF, M_NOWAIT);
+ if (ih == NULL)
+ panic("couldn't malloc intrhand");
ih->ih_arg = sc;
ih->ih_map = mapper;
ih->ih_clr = clearer;
diff --git a/sys/arch/sparc64/dev/sbus.c b/sys/arch/sparc64/dev/sbus.c
index 652c414b5bd..c9c776f0d84 100644
--- a/sys/arch/sparc64/dev/sbus.c
+++ b/sys/arch/sparc64/dev/sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbus.c,v 1.8 2002/01/04 05:19:25 jason Exp $ */
+/* $OpenBSD: sbus.c,v 1.9 2002/01/10 00:06:17 nordin Exp $ */
/* $NetBSD: sbus.c,v 1.46 2001/10/07 20:30:41 eeh Exp $ */
/*-
@@ -337,6 +337,8 @@ sbus_attach(parent, self, aux)
/* Enable the over temp intr */
ih = (struct intrhand *)
malloc(sizeof(struct intrhand), M_DEVBUF, M_NOWAIT);
+ if (ih == NULL)
+ panic("couldn't malloc intrhand");
ih->ih_map = &sc->sc_sysio->therm_int_map;
ih->ih_clr = NULL; /* &sc->sc_sysio->therm_clr_int; */
ih->ih_fun = sbus_overtemp;