ACPICA: Fix possible memory leak for module-level code execution
[safe/jmp/linux-2.6] / drivers / acpi / glue.c
index dc36a44..4c8fcff 100644 (file)
@@ -95,15 +95,13 @@ do_acpi_find_child(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
        acpi_status status;
        struct acpi_device_info *info;
-       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        struct acpi_find_child *find = context;
 
-       status = acpi_get_object_info(handle, &buffer);
+       status = acpi_get_object_info(handle, &info);
        if (ACPI_SUCCESS(status)) {
-               info = buffer.pointer;
                if (info->address == find->address)
                        find->handle = handle;
-               kfree(buffer.pointer);
+               kfree(info);
        }
        return AE_OK;
 }
@@ -115,7 +113,7 @@ acpi_handle acpi_get_child(acpi_handle parent, acpi_integer address)
        if (!parent)
                return NULL;
        acpi_walk_namespace(ACPI_TYPE_DEVICE, parent,
-                           1, do_acpi_find_child, &find, NULL);
+                           1, do_acpi_find_child, NULL, &find, NULL);
        return find.handle;
 }
 
@@ -123,7 +121,7 @@ EXPORT_SYMBOL(acpi_get_child);
 
 /* Link ACPI devices with physical devices */
 static void acpi_glue_data_handler(acpi_handle handle,
-                                  u32 function, void *context)
+                                  void *context)
 {
        /* we provide an empty handler */
 }