[PATCH] acpi: ras2: stop for loop when list exceeds the table

Ivan Hu ivan.hu at canonical.com
Mon Jan 29 07:18:54 UTC 2024


Just return the function when the PCC descriptor list exceeds the table.

Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
 src/acpi/ras2/ras2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/acpi/ras2/ras2.c b/src/acpi/ras2/ras2.c
index 2c604796..a6f42c1e 100644
--- a/src/acpi/ras2/ras2.c
+++ b/src/acpi/ras2/ras2.c
@@ -50,7 +50,7 @@ static int ras2_test1(fwts_framework *fw)
 			fwts_failed(fw, LOG_LEVEL_HIGH, "RAS2TooShort",
 				"RAS2 table too short, PCC descriptor list exceeds the table.");
 			passed = false;
-			break;
+			return FWTS_OK;
 		}
 		fwts_acpi_ras2_pcc_desc *pcc_desc = (fwts_acpi_ras2_pcc_desc *)(table->data + offset);
 		fwts_log_info_verbatim(fw, "  PCC Descriptor List:");
-- 
2.34.1




More information about the fwts-devel mailing list