ACPICA: Fix an ACPI_ALLOCATE_ZEROED() reversal.
authorLv Zheng <lv.zheng@intel.com>
Thu, 31 Oct 2013 01:30:42 +0000 (09:30 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 31 Oct 2013 13:37:33 +0000 (14:37 +0100)
ACPI_FREE() should always be used to free objects allocated with
ACPI_ALLOCATE_ZEROED(), so make acpi_ut_create_package_object() do
that.

This patch ports a fix from ACPICA upstream to Linux and helps to
reduce source code differences between them.

[rjw: Changelog]
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/utobject.c

index cddb0ef5b9b75a1cfee09ecd4ee3cbef0c6febbb..d2a7b61237434c2155e8c990566ddeabe8728fba 100644 (file)
@@ -180,7 +180,7 @@ union acpi_operand_object *acpi_ut_create_package_object(u32 count)
        package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size) count +
                                                 1) * sizeof(void *));
        if (!package_elements) {
-               acpi_ut_remove_reference(package_desc);
+               ACPI_FREE(package_desc);
                return_PTR(NULL);
        }