]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ACPI/PCI: handle multiple _OSC
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Mon, 12 May 2008 13:55:45 +0000 (22:55 +0900)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 13 May 2008 16:51:54 +0000 (09:51 -0700)
The pci_osc_control_set() function can be called for the ACPI object
that doesn't have _OSC method. In this case, acpi_get_osc_data() would
allocate a useless memory region. To avoid this, we need to check the
existence of _OSC before calling acpi_get_osc_data(). Here is a patch
to fix this problem in pci_osc_control_set.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/pci-acpi.c

index 468d13e1458e3f586bf9dac4f7b9ddc206dff521..38fc8b1ff8814456a09754f12668efd3ba2a0b62 100644 (file)
@@ -232,8 +232,14 @@ acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
 {
        acpi_status     status;
        u32             ctrlset;
-       struct acpi_osc_data *osc_data = acpi_get_osc_data(handle);
+       acpi_handle tmp;
+       struct acpi_osc_data *osc_data;
+
+       status = acpi_get_handle(handle, "_OSC", &tmp);
+       if (ACPI_FAILURE(status))
+               return status;
 
+       osc_data = acpi_get_osc_data(handle);
        if (!osc_data) {
                printk(KERN_ERR "acpi osc data array is full\n");
                return AE_ERROR;