diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2008-05-13 03:48:50 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-05-13 12:51:54 -0400 |
commit | c4e5fadd2a6fc0da465dcde761877d9a87313b33 (patch) | |
tree | 8dc0fe170bde8997fe41a27f5b9115e4e31bcc64 /drivers/pci | |
parent | 77db9885646f8a88214ea482988d41f8f73630f4 (diff) |
ACPI/PCI: another multiple _OSC memory leak fix
The acpi_query_osc() 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() in acpi_query_osc().
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.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 38fc8b1ff881..9d6fc8e6285d 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -60,9 +60,15 @@ acpi_query_osc ( | |||
60 | union acpi_object *out_obj; | 60 | union acpi_object *out_obj; |
61 | u32 osc_dw0; | 61 | u32 osc_dw0; |
62 | acpi_status *ret_status = (acpi_status *)retval; | 62 | acpi_status *ret_status = (acpi_status *)retval; |
63 | struct acpi_osc_data *osc_data = acpi_get_osc_data(handle); | 63 | struct acpi_osc_data *osc_data; |
64 | u32 flags = (unsigned long)context, temp; | 64 | u32 flags = (unsigned long)context, temp; |
65 | acpi_handle tmp; | ||
65 | 66 | ||
67 | status = acpi_get_handle(handle, "_OSC", &tmp); | ||
68 | if (ACPI_FAILURE(status)) | ||
69 | return status; | ||
70 | |||
71 | osc_data = acpi_get_osc_data(handle); | ||
66 | if (!osc_data) { | 72 | if (!osc_data) { |
67 | printk(KERN_ERR "acpi osc data array is full\n"); | 73 | printk(KERN_ERR "acpi osc data array is full\n"); |
68 | return AE_ERROR; | 74 | return AE_ERROR; |