summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Hargrave <jordan@cvs.openbsd.org>2010-07-10 04:59:57 +0000
committerJordan Hargrave <jordan@cvs.openbsd.org>2010-07-10 04:59:57 +0000
commit714e5a78defd4bff9098192c04ba95a10dae9f76 (patch)
tree75eba92fdf318530e74b66a8de90a1283f9e9d75
parent57d4028ec6ef2e2b8b9f00e2fd378a128848a6aa (diff)
Verify _ADR bdf is correct (some systems return 0xffff)
Works on Dell x9xx and Studio 1555
-rw-r--r--sys/dev/acpi/acpi.c6
-rw-r--r--sys/dev/acpi/acpiprt.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 1d3480efe62..b1bfcb2473c 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.174 2010/07/09 12:27:02 jordan Exp $ */
+/* $OpenBSD: acpi.c,v 1.175 2010/07/10 04:59:56 jordan Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -606,6 +606,10 @@ acpi_getpci(struct aml_node *node, void *arg)
aml_nodename(node));
/* Check if PCI device exists */
+ if (pci->dev > 0x1F || pci->fun > 7) {
+ free(pci, M_DEVBUF);
+ return (1);
+ }
tag = pci_make_tag(pc, pci->bus, pci->dev, pci->fun);
reg = pci_conf_read(pc, tag, PCI_ID_REG);
if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID) {
diff --git a/sys/dev/acpi/acpiprt.c b/sys/dev/acpi/acpiprt.c
index 24cfe86b72e..cc8daaf11c6 100644
--- a/sys/dev/acpi/acpiprt.c
+++ b/sys/dev/acpi/acpiprt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpiprt.c,v 1.39 2010/07/08 20:56:31 jordan Exp $ */
+/* $OpenBSD: acpiprt.c,v 1.40 2010/07/10 04:59:55 jordan Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org>
*
@@ -114,7 +114,7 @@ acpiprt_attach(struct device *parent, struct device *self, void *aux)
printf("%s: bus mismatch, new:%d old:%d\n",
aml_nodename(sc->sc_devnode),
nbus, sc->sc_bus);
- panic("aiiiee..");
+ sc->sc_bus = nbus;
}
if (aml_evalnode(sc->sc_acpi, sc->sc_devnode, 0, NULL, &res)) {