summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/nswalk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/nswalk.c')
-rw-r--r--drivers/acpi/acpica/nswalk.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c
index b7f3e8603ad8..5670ff5a43cd 100644
--- a/drivers/acpi/acpica/nswalk.c
+++ b/drivers/acpi/acpica/nswalk.c
@@ -3,7 +3,7 @@
*
* Module Name: nswalk - Functions for walking the ACPI namespace
*
- * Copyright (C) 2000 - 2020, Intel Corp.
+ * Copyright (C) 2000 - 2025, Intel Corp.
*
*****************************************************************************/
@@ -171,6 +171,12 @@ acpi_ns_walk_namespace(acpi_object_type type,
start_node = acpi_gbl_root_node;
}
+ /* Avoid walking the namespace if the StartNode is NULL */
+
+ if (!start_node) {
+ return_ACPI_STATUS(AE_NO_NAMESPACE);
+ }
+
/* Null child means "get first node" */
parent_node = start_node;