diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2008-05-12 15:55:45 +0200 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-05-13 18:51:54 +0200 |
commit | 34a65055e5e7304b3d6ad0f7542bf66308eae50a (patch) | |
tree | 256235d6c54d8701a00811235271c14ddb232ba8 /drivers/pci/pci-acpi.c | |
parent | ACPI/PCI: handle multiple _OSC (diff) | |
download | linux-34a65055e5e7304b3d6ad0f7542bf66308eae50a.tar.xz linux-34a65055e5e7304b3d6ad0f7542bf66308eae50a.zip |
ACPI/PCI: handle multiple _OSC
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>
Diffstat (limited to 'drivers/pci/pci-acpi.c')
-rw-r--r-- | drivers/pci/pci-acpi.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 468d13e1458e..38fc8b1ff881 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -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; |