linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ACPI: NULL pointer checking
@ 2017-09-06 13:35 Zhenhua
  2017-09-06 16:42 ` Moore, Robert
  0 siblings, 1 reply; 3+ messages in thread
From: Zhenhua @ 2017-09-06 13:35 UTC (permalink / raw)
  To: devel, robert.moore, lv.zheng, rafael.j.wysocki, lenb,
	linux-acpi, linux-kernel
  Cc: Zhenhua

These two pointers should be checked, for some broken devices they may
cause system crash.

Signed-off-by: Zhenhua <lizhenhuajiyang@163.com>
---
 drivers/acpi/acpica/nsaccess.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index f2733f51ca8d..151abb0ef4d5 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -338,7 +338,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
 			return_ACPI_STATUS(AE_AML_INTERNAL);
 		}
 
-		if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) {
+		if ((!prefix_node) && (!(flags & ACPI_NS_PREFIX_IS_SCOPE))) {
 			/*
 			 * This node might not be a actual "scope" node (such as a
 			 * Device/Method, etc.)  It could be a Package or other object
@@ -369,7 +369,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
 		ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
 				  "Null Pathname (Zero segments), Flags=%X\n",
 				  flags));
-	} else {
+	} else if (path) {
 		/*
 		 * Name pointer is valid (and must be in internal name format)
 		 *
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-07 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06 13:35 [PATCH 1/1] ACPI: NULL pointer checking Zhenhua
2017-09-06 16:42 ` Moore, Robert
2017-09-07 19:26   ` Moore, Robert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).