aboutsummaryrefslogtreecommitdiff
path: root/sys/pci/ohci_pci.c
diff options
context:
space:
mode:
authorNick Hibma <n_hibma@FreeBSD.org>1999-10-03 20:23:25 +0000
committerNick Hibma <n_hibma@FreeBSD.org>1999-10-03 20:23:25 +0000
commitaa9b0faecb44aeaf541a848cfe3bc8777d41c8e9 (patch)
treeaa8a8bc7431e270b3707419867b735067beba1e9 /sys/pci/ohci_pci.c
parentbf3367d09131ea9a66d7e8301407e77e59078829 (diff)
downloadsrc-aa9b0faecb44aeaf541a848cfe3bc8777d41c8e9.tar.gz
src-aa9b0faecb44aeaf541a848cfe3bc8777d41c8e9.zip
Check for a valid irq number before calling BUS_SETUP_INTR.
Requested-By: msmith
Notes
Notes: svn path=/head/; revision=51914
Diffstat (limited to 'sys/pci/ohci_pci.c')
-rw-r--r--sys/pci/ohci_pci.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/pci/ohci_pci.c b/sys/pci/ohci_pci.c
index 28dff3e8269b..6c90da4c25fc 100644
--- a/sys/pci/ohci_pci.c
+++ b/sys/pci/ohci_pci.c
@@ -56,7 +56,6 @@
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>
-#include <sys/device.h>
#include <sys/proc.h>
#include <sys/queue.h>
#include <machine/bus.h>
@@ -145,6 +144,7 @@ ohci_pci_attach(device_t self)
int rid;
struct resource *res;
void *ih;
+ int intr;
rid = PCI_CBMEM;
res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid,
@@ -200,6 +200,14 @@ ohci_pci_attach(device_t self)
sprintf(sc->sc_vendor, "(unknown)");
}
+ intr = pci_read_config(self, PCIR_INTLINE, 1);
+ if (intr == 0 || intr == 255) {
+ device_printf(self, "Invalid irq %d\n", intr);
+ device_printf(self, "Please switch on USB support and switch PNP-OS to 'No' in BIOS\n");
+ device_delete_child(self, usbus);
+ return ENXIO;
+ }
+
err = BUS_SETUP_INTR(parent, self, res, INTR_TYPE_BIO,
(driver_intr_t *) ohci_intr, sc, &ih);
if (err) {