提交 c4e5fadd 编写于 作者: K Kenji Kaneshige 提交者: Jesse Barnes

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: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 77db9885
...@@ -60,9 +60,15 @@ acpi_query_osc ( ...@@ -60,9 +60,15 @@ acpi_query_osc (
union acpi_object *out_obj; union acpi_object *out_obj;
u32 osc_dw0; u32 osc_dw0;
acpi_status *ret_status = (acpi_status *)retval; acpi_status *ret_status = (acpi_status *)retval;
struct acpi_osc_data *osc_data = acpi_get_osc_data(handle); struct acpi_osc_data *osc_data;
u32 flags = (unsigned long)context, temp; u32 flags = (unsigned long)context, temp;
acpi_handle tmp;
status = acpi_get_handle(handle, "_OSC", &tmp);
if (ACPI_FAILURE(status))
return status;
osc_data = acpi_get_osc_data(handle);
if (!osc_data) { if (!osc_data) {
printk(KERN_ERR "acpi osc data array is full\n"); printk(KERN_ERR "acpi osc data array is full\n");
return AE_ERROR; return AE_ERROR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册