[PATCH] acpi: method: skip over bad method_handle and failed message type
Colin King
colin.king at canonical.com
Thu Jul 4 16:15:41 UTC 2019
From: Colin Ian King <colin.king at canonical.com>
When fetching the method_handle and the message type there are
issues warning about failures but no real error handling. This
can lead to an uninitialized method_handle being passed into
AcpiGetType that can cause an uninitialized pointer read. Fix
these failures by continuing on to the next method inthe list.
Addresses-Coverity: ("Uninitialized pointer read")
Fixes: e2a21f8d75d8 ("acpi: method: skip scope names in method_evaluate_method")
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/acpi/method/method.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index eeb9c7fa..787e3438 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -410,10 +410,12 @@ static int method_evaluate_method(fwts_framework *fw,
status = AcpiGetHandle (NULL, method_name, &method_handle);
if (ACPI_FAILURE(status)) {
fwts_warning(fw, "Failed to get handle for object %s.", name);
+ continue;
}
status = AcpiGetType(method_handle, &type);
if (ACPI_FAILURE(status)) {
fwts_warning(fw, "Failed to get object type for %s.",name);
+ continue;
}
if (type == ACPI_TYPE_LOCAL_SCOPE)
--
2.20.1
More information about the fwts-devel
mailing list