ACPICA: ACPICA: replace ACPI_FREE() with acpi_ut_delete_object_desc()

acpi_ut_create_internal_object() may allocate memory from a slab cache
via kmem_cache_zalloc(), but the code currently frees it with ACPI_FREE(),
which calls kfree().

This mismatch prevents the object from being released properly and may
lead to memory leaks or other issues.

Fix this by replacing ACPI_FREE() with acpi_ut_delete_object_desc(),
which matches the allocation method used for internal objects.

Link: https://github.com/acpica/acpica/commit/a1c55dfea194
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/4710853.LvFx2qVVIh@rafael.j.wysocki
This commit is contained in:
Zilin Guan 2026-01-14 13:17:36 +01:00 committed by Rafael J. Wysocki
parent d6f6bae3ec
commit 05390d31d7
2 changed files with 2 additions and 2 deletions

View File

@ -601,7 +601,7 @@ acpi_status acpi_install_method(u8 *buffer)
error_exit:
ACPI_FREE(aml_buffer);
ACPI_FREE(method_obj);
acpi_ut_delete_object_desc(method_obj);
return (status);
}
ACPI_EXPORT_SYMBOL(acpi_install_method)

View File

@ -148,7 +148,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_FREE(package_desc);
acpi_ut_delete_object_desc(package_desc);
return_PTR(NULL);
}