summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-06-03 20:12:12 +0000
committerimp <imp@FreeBSD.org>2005-06-03 20:12:12 +0000
commit046df800974bd8b2e1278f178f6dbeabb12dcf56 (patch)
tree0979f2400414de2e848579abfd620b484e8ed815
parent70eb7340eaffafecab73f10e98a5afc0b8a8bd3e (diff)
downloadFreeBSD-src-046df800974bd8b2e1278f178f6dbeabb12dcf56.zip
FreeBSD-src-046df800974bd8b2e1278f178f6dbeabb12dcf56.tar.gz
In newbus land, ivars can only be accessed for direct child, or when
the driver has unholy private knowledge of its great-*cgrandchildren. The ACPI allocation routine lacked such knowledge when it tried to do a default allocation for all descendants, rather than just its immeidate children, so would access grandchild's ivar in an unsafe way. This could lead to a panic when devices were present which had no addresses setup by the BIOS, but which were later allocated in a lazy manner via pci_alloc_map. As such, only do the default allocation adjustments for immediate children. The manner that acpi_sysres_find accesses the resource list, used later in acpi_alloc_resource, is safe and proper so no additional test is needed there. This fixes a panic when probing an disabled ata controller on some newer intel blades. Reported by: dwhite
-rw-r--r--sys/dev/acpica/acpi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 2499bcd..896e3a7 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -979,7 +979,7 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid,
* we know what the resources for this device are (i.e., they're on the
* child's resource list), use those start/end values.
*/
- if (start == 0UL && end == ~0UL) {
+ if (bus == device_get_parent(child) && start == 0UL && end == ~0UL) {
rle = resource_list_find(rl, type, *rid);
if (rle == NULL)
goto out;
OpenPOWER on IntegriCloud