Skip to content

Commit 54ba907

Browse files
kaushlenrafaeljw
authored andcommitted
ACPICA: acpidump: fix return values in ap_is_valid_checksum()
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: acpica/acpica@479ba862 Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 81f92cf commit 54ba907

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tools/power/acpi/tools/acpidump/apdump.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ u8 ap_is_valid_checksum(struct acpi_table_header *table)
8686
if (ACPI_FAILURE(status)) {
8787
fprintf(stderr, "%4.4s: Warning: wrong checksum in table\n",
8888
table->signature);
89+
return (FALSE);
8990
}
9091

91-
return (AE_OK);
92+
return (TRUE);
9293
}
9394

9495
/******************************************************************************

0 commit comments

Comments
 (0)