ACPICA: acpidump: fix return values in ap_is_valid_checksum()
Subsystems (2)
PATCH 1/1 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
--- tools/power/acpi/tools/acpidump/apdump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/power/acpi/tools/acpidump/apdump.c +2 -1
@@ -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); }/******************************************************************************
Signature · 1 line
2.34.1
Rafael J. Wysocki
maintainerQuoted 10 lines · Kaushlendra Kumar
The function
ap_is_valid_checksum()has a boolean name suggesting it should return TRUE/FALSE, but incorrectly returnsAE_OKon 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 succeedsSigned-off-by Kaushlendra Kumar <[email protected]>
Please submit ACPICA changes to the upstream ACPICA project on GitHub.
They are not going to be applied directly to the Linux kernel code unless they are based on existing upstream ACPICA commits.
Quoted 23 lines
--- tools/power/acpi/tools/acpidump/apdump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tools/power/acpi/tools/acpidump/apdump.c +2
-2@@ -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.34.1