[PATCH v2 41/42] ACPICA: namespace: Fix memory leak around compiler alias flag
From: Maciej Wieczor-Retman
Date: Fri Nov 20 2026 - 12:28:29 EST
ANOBJ_IS_ALIAS is an iASL only flag that shares the bit position with
ANOBJ_ALLOCATED_BUFFER, which is a flag used for runtime installing
methods. Due to the bits matching a memory leak happens everytime a
method is loaded in acpiexec (using AcpiInstallMethod()).
Check the compiler related flag only when the code is ran by the
compiler.
Link: https://github.com/acpica/acpica/commit/b01f4e055910
Fixes: 8d7987340301 ("ACPICA: Add alias node support in namespace handling")
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@xxxxxxxxx>
---
drivers/acpi/acpica/nsobject.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/acpica/nsobject.c b/drivers/acpi/acpica/nsobject.c
index 49d9d917fa73..6eb278b9d714 100644
--- a/drivers/acpi/acpica/nsobject.c
+++ b/drivers/acpi/acpica/nsobject.c
@@ -175,8 +175,11 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node)
/* Alias nodes point directly to other namespace nodes; skip teardown */
if ((node->type == ACPI_TYPE_LOCAL_ALIAS) ||
- (node->type == ACPI_TYPE_LOCAL_METHOD_ALIAS) ||
- (node->flags & ANOBJ_IS_ALIAS)) {
+ (node->type == ACPI_TYPE_LOCAL_METHOD_ALIAS)
+#if defined ACPI_ASL_COMPILER
+ || (node->flags & ANOBJ_IS_ALIAS)
+#endif
+ ) {
node->object = NULL;
return_VOID;
}
--
2.56.0