From: Erik Schmauss Date: Mon, 8 Apr 2019 20:42:29 +0000 (-0700) Subject: ACPICA: Namespace: add check to avoid null pointer dereference X-Git-Tag: v5.2-rc1~183^2~3^2^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=df9271d69f4016c1169699de9a826745688103bd;p=thirdparty%2Fkernel%2Flinux.git ACPICA: Namespace: add check to avoid null pointer dereference 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 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index 5470213b8e645..6eb63db72249b 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);