diff options
Diffstat (limited to 'sys/arch/macppc/dev/macintr.c')
-rw-r--r-- | sys/arch/macppc/dev/macintr.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/arch/macppc/dev/macintr.c b/sys/arch/macppc/dev/macintr.c index 8e716c235c3..f5013891eaa 100644 --- a/sys/arch/macppc/dev/macintr.c +++ b/sys/arch/macppc/dev/macintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macintr.c,v 1.47 2014/07/12 18:44:42 tedu Exp $ */ +/* $OpenBSD: macintr.c,v 1.48 2014/08/30 09:42:20 mpi Exp $ */ /*- * Copyright (c) 2008 Dale Rahn <drahn@openbsd.org> @@ -285,14 +285,16 @@ macintr_establish(void * lcv, int irq, int type, int level, printf("macintr_establish, hI %d L %d %s", irq, level, ppc_intr_typename(type)); #endif + if (!LEGAL_IRQ(irq) || type == IST_NONE) { + printf("%s: bogus irq %d or type %d", __func__, irq, type); + return (NULL); + } + /* no point in sleeping unless someone can free memory. */ ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK); if (ih == NULL) panic("intr_establish: can't malloc handler info"); - if (!LEGAL_IRQ(irq) || type == IST_NONE) - panic("intr_establish: bogus irq or type"); - iq = &macintr_handler[irq]; switch (iq->iq_ist) { case IST_NONE: @@ -344,8 +346,10 @@ macintr_disestablish(void *lcp, void *arg) int s; struct intrq *iq; - if (!LEGAL_IRQ(irq)) - panic("intr_disestablish: bogus irq"); + if (!LEGAL_IRQ(irq)) { + printf("%s: bogus irq %d", __func__, irq); + return; + } /* * Remove the handler from the chain. |