Skip to content

Commit 9d6c58d

Browse files
Cryolitiarafaeljw
authored andcommitted
ACPICA: Avoid walking the Namespace if start_node is NULL
Although commit 0c99923 ("ACPICA: Avoid walking the ACPI Namespace if it is not there") fixed the situation when both start_node and acpi_gbl_root_node are NULL, the Linux kernel mainline now still crashed on Honor Magicbook 14 Pro [1]. That happens due to the access to the member of parent_node in acpi_ns_get_next_node(). The NULL pointer dereference will always happen, no matter whether or not the start_node is equal to ACPI_ROOT_OBJECT, so move the check of start_node being NULL out of the if block. Unfortunately, all the attempts to contact Honor have failed, they refused to provide any technical support for Linux. The bad DSDT table's dump could be found on GitHub [2]. DMI: HONOR FMB-P/FMB-P-PCB, BIOS 1.13 05/08/2025 Link: acpica/acpica@1c1b57b Link: https://gist.github.com/Cryolitia/a860ffc97437dcd2cd988371d5b73ed7 [1] Link: https://github.com/denis-bb/honor-fmb-p-dsdt [2] Signed-off-by: Cryolitia PukNgae <cryolitia.pukngae@linux.dev> Reviewed-by: WangYuli <wangyl5933@chinaunicom.cn> [ rjw: Subject adjustment, changelog edits ] Link: https://patch.msgid.link/20251125-acpica-v1-1-99e63b1b25f8@linux.dev Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent ac3fd01 commit 9d6c58d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/acpi/acpica/nswalk.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,12 @@ acpi_ns_walk_namespace(acpi_object_type type,
169169

170170
if (start_node == ACPI_ROOT_OBJECT) {
171171
start_node = acpi_gbl_root_node;
172-
if (!start_node) {
173-
return_ACPI_STATUS(AE_NO_NAMESPACE);
174-
}
172+
}
173+
174+
/* Avoid walking the namespace if the StartNode is NULL */
175+
176+
if (!start_node) {
177+
return_ACPI_STATUS(AE_NO_NAMESPACE);
175178
}
176179

177180
/* Null child means "get first node" */

0 commit comments

Comments
 (0)