summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-01-27 20:33:33 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-01-27 20:33:33 +0100
commitb1c3656ef4950098e530be68d4b589584f06cddc (patch)
tree56125dc5762d7537590e8230dc21c72c6529bf89
parentb32dde35e26a63a85d78d4dc0a7260b61e626ac1 (diff)
downloadacpica-b1c3656ef4950098e530be68d4b589584f06cddc.tar.gz
Namespace: Avoid walking the Namespace if it is not there
Prevent AcpiNsWalkNamespace () from crashing when called with StartNode equal to ACPI_ROOT_OBJECT if the Namespace has not been instantiated yet and AcpiGbl_RootNode is NULL. For instance, this can happen in the Linux kernel if it is run with "acpi=off" in the command line. Reported-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/linux-acpi/6a0233cd-d931-8a36-3b9e-08b774cec7b0@redhat.com/ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--source/components/namespace/nswalk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/components/namespace/nswalk.c b/source/components/namespace/nswalk.c
index 50c5ed5ba..b1e114490 100644
--- a/source/components/namespace/nswalk.c
+++ b/source/components/namespace/nswalk.c
@@ -322,6 +322,10 @@ AcpiNsWalkNamespace (
if (StartNode == ACPI_ROOT_OBJECT)
{
StartNode = AcpiGbl_RootNode;
+ if (!StartNode)
+ {
+ return_ACPI_STATUS (AE_NO_NAMESPACE);
+ }
}
/* Null child means "get first node" */