[PATCH] acpi: fpdt: add a terminate for buggy BIOS that reports zero length

Alex Hung alex.hung at canonical.com
Wed Dec 9 07:32:01 UTC 2015


On Supermicro's C7Q67, BIOS reports Performance Record Type 0 with
zero length and it causes fpdt test to run into infinite loop.  As
the data is considered corrupted, it is better to terminate the
test instead of checking others.

Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 src/acpi/fpdt/fpdt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/acpi/fpdt/fpdt.c b/src/acpi/fpdt/fpdt.c
index f5e4550..0d059be 100644
--- a/src/acpi/fpdt/fpdt.c
+++ b/src/acpi/fpdt/fpdt.c
@@ -203,6 +203,10 @@ static int fpdt_test1(fwts_framework *fw)
 			break;
 		}
 		ptr += fpdt->length;
+
+		/* terminate loop for buggy BIOS */
+		if (fpdt->length == 0)
+			break;
 	}
 
 done:
-- 
1.9.1




More information about the fwts-devel mailing list