aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2008-05-12 09:55:45 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-05-13 12:51:54 -0400
commit34a65055e5e7304b3d6ad0f7542bf66308eae50a (patch)
tree256235d6c54d8701a00811235271c14ddb232ba8 /drivers/pci
parenta5d1c8798309a384c2776e5ff472f8ceb6d9065d (diff)
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')
-rw-r--r--drivers/pci/pci-acpi.c8
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)
232{ 232{
233 acpi_status status; 233 acpi_status status;
234 u32 ctrlset; 234 u32 ctrlset;
235 struct acpi_osc_data *osc_data = acpi_get_osc_data(handle); 235 acpi_handle tmp;
236 struct acpi_osc_data *osc_data;
237
238 status = acpi_get_handle(handle, "_OSC", &tmp);
239 if (ACPI_FAILURE(status))
240 return status;
236 241
242 osc_data = acpi_get_osc_data(handle);
237 if (!osc_data) { 243 if (!osc_data) {
238 printk(KERN_ERR "acpi osc data array is full\n"); 244 printk(KERN_ERR "acpi osc data array is full\n");
239 return AE_ERROR; 245 return AE_ERROR;