From e1128bd07d48d6e5290924e7436cee2c89c7bb06 Mon Sep 17 00:00:00 2001 From: jlemon Date: Fri, 7 Apr 2000 00:09:24 +0000 Subject: [PATCH] If we can't allocate an IRQ resource, fail in the attach routine. --- sys/dev/ppbus/ppi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/ppbus/ppi.c b/sys/dev/ppbus/ppi.c index 2015fceeee56..971d3176b3f2 100644 --- a/sys/dev/ppbus/ppi.c +++ b/sys/dev/ppbus/ppi.c @@ -173,6 +173,10 @@ ppi_attach(device_t dev) /* declare our interrupt handler */ ppi->intr_resource = bus_alloc_resource(dev, SYS_RES_IRQ, &zero, irq, irq, 1, RF_ACTIVE); + if (ppi->intr_resource == NULL) { + device_printf(dev, "can't allocate irq\n"); + return (ENOMEM); + } make_dev(&ppi_cdevsw, device_get_unit(dev), /* XXX cleanup */ UID_ROOT, GID_WHEEL,