[PATCH v1 16/16] ACPICA: acpidump: fix return values in ap_is_valid_checksum()

Rafael J. Wysocki
2025-09-12T20:06:19Z

From: Kaushlendra Kumar <kaushlendra.kumar@intel.com>

The function ap_is_valid_checksum() has a boolean name suggesting it
should return TRUE/FALSE, but incorrectly returns AE_OK on success and
has no explicit return on failure, leading to undefined behavior.

Fix by returning proper values:
- FALSE when checksum validation fails
- TRUE when checksum validation succeeds

Link: https://github.com/acpica/acpica/commit/479ba862
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
tools/power/acpi/tools/acpidump/apdump.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c
index bf30143efbdc..7a6223aa703c 100644
--- a/tools/power/acpi/tools/acpidump/apdump.c
+++ b/tools/power/acpi/tools/acpidump/apdump.c
@@ -86,9 +86,10 @@ u8 ap_is_valid_checksum(struct acpi_table_header *table)
if (ACPI_FAILURE(status)) {
fprintf(stderr, "%4.4s: Warning: wrong checksum in table\n",
table->signature);
+ return (FALSE);
}

- return (AE_OK);
+ return (TRUE);
}

/******************************************************************************
--
2.51.0