summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2016-08-06 18:21:35 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2016-08-06 18:21:35 +0000
commit0253ed4b5cf63d8de0c6397aa5cf8592f3192e34 (patch)
tree73a213576b1b77a84c2bd7d8a4c6a127b8a8d967
parentc189f7b4468b9c48e187d065272bd503a582d0fd (diff)
Always allocate intrhand with M_WAITOK.
Requested by and ok kettenis@
-rw-r--r--sys/arch/armv7/omap/intc.c8
-rw-r--r--sys/arch/armv7/omap/omgpio.c8
-rw-r--r--sys/arch/armv7/sunxi/sxiintc.c8
3 files changed, 6 insertions, 18 deletions
diff --git a/sys/arch/armv7/omap/intc.c b/sys/arch/armv7/omap/intc.c
index 6fb563266d0..a68a5be5741 100644
--- a/sys/arch/armv7/omap/intc.c
+++ b/sys/arch/armv7/omap/intc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intc.c,v 1.6 2016/08/06 10:07:45 jsg Exp $ */
+/* $OpenBSD: intc.c,v 1.7 2016/08/06 18:21:34 patrick Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -364,11 +364,7 @@ intc_intr_establish(int irqno, int level, int (*func)(void *),
irqno, name);
psw = disable_interrupts(PSR_I);
- /* no point in sleeping unless someone can free memory. */
- ih = (struct intrhand *)malloc (sizeof *ih, M_DEVBUF,
- cold ? M_NOWAIT : M_WAITOK);
- if (ih == NULL)
- panic("intr_establish: can't malloc handler info");
+ ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
ih->ih_func = func;
ih->ih_arg = arg;
ih->ih_ipl = level;
diff --git a/sys/arch/armv7/omap/omgpio.c b/sys/arch/armv7/omap/omgpio.c
index 700e25362cd..c964553093f 100644
--- a/sys/arch/armv7/omap/omgpio.c
+++ b/sys/arch/armv7/omap/omgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omgpio.c,v 1.7 2016/07/17 00:25:21 jsg Exp $ */
+/* $OpenBSD: omgpio.c,v 1.8 2016/08/06 18:21:34 patrick Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -616,11 +616,7 @@ omgpio_intr_establish(struct omgpio_softc *sc, unsigned int gpio, int level, int
psw = disable_interrupts(PSR_I);
- /* no point in sleeping unless someone can free memory. */
- ih = (struct intrhand *)malloc( sizeof *ih, M_DEVBUF,
- cold ? M_NOWAIT : M_WAITOK);
- if (ih == NULL)
- panic("intr_establish: can't malloc handler info");
+ ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
ih->ih_func = func;
ih->ih_arg = arg;
ih->ih_ipl = level;
diff --git a/sys/arch/armv7/sunxi/sxiintc.c b/sys/arch/armv7/sunxi/sxiintc.c
index 452361ecd76..e593997afc1 100644
--- a/sys/arch/armv7/sunxi/sxiintc.c
+++ b/sys/arch/armv7/sunxi/sxiintc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sxiintc.c,v 1.1 2016/08/05 20:38:17 kettenis Exp $ */
+/* $OpenBSD: sxiintc.c,v 1.2 2016/08/06 18:21:34 patrick Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2013 Artturi Alm
@@ -388,11 +388,7 @@ sxiintc_intr_establish(int irq, int level, int (*func)(void *),
psw = disable_interrupts(PSR_I);
- /* no point in sleeping unless someone can free memory. */
- ih = (struct intrhand *)malloc (sizeof *ih, M_DEVBUF,
- cold ? M_NOWAIT : M_WAITOK);
- if (ih == NULL)
- panic("intr_establish: can't malloc handler info\n");
+ ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
ih->ih_func = func;
ih->ih_arg = arg;
ih->ih_ipl = level;