diff options
author | 2016-08-06 18:21:34 +0000 | |
---|---|---|
committer | 2016-08-06 18:21:34 +0000 | |
commit | a8511e668401a33894bf96192e05809cb00444ef (patch) | |
tree | ae72d03d7e93c04281b604aa17301ca54a45efdc /sys | |
parent | Always allocate intrhand with M_WAITOK. (diff) | |
download | wireguard-openbsd-a8511e668401a33894bf96192e05809cb00444ef.tar.xz wireguard-openbsd-a8511e668401a33894bf96192e05809cb00444ef.zip |
Always allocate intrhand with M_WAITOK.
Requested by and ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/armv7/omap/intc.c | 8 | ||||
-rw-r--r-- | sys/arch/armv7/omap/omgpio.c | 8 | ||||
-rw-r--r-- | sys/arch/armv7/sunxi/sxiintc.c | 8 |
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; |