diff mbox series

[7/8] ACPICA: Namespace: add check to avoid null pointer dereference

Message ID 20190408204230.4335-8-erik.schmauss@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Rafael Wysocki
Headers show
Series ACPICA release 20190329 and 20190405 | expand

Commit Message

Schmauss, Erik April 8, 2019, 8:42 p.m. UTC
ACPICA commit 7586a625f9c34c3169efd88470192bf63119e31a

Some ACPICA userspace tools call acpi_ut_subsystem_shutdown() during
cleanup and dereference a null pointer when cleaning up the
namespace.

Link: https://github.com/acpica/acpica/commit/7586a625
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/nsalloc.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c
index 5470213b8e64..6eb63db72249 100644
--- a/drivers/acpi/acpica/nsalloc.c
+++ b/drivers/acpi/acpica/nsalloc.c
@@ -74,6 +74,10 @@  void acpi_ns_delete_node(struct acpi_namespace_node *node)
 
 	ACPI_FUNCTION_NAME(ns_delete_node);
 
+	if (!node) {
+		return_VOID;
+	}
+
 	/* Detach an object if there is one */
 
 	acpi_ns_detach_object(node);