diff mbox

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

Message ID 1449646321-26857-1-git-send-email-alex.hung@canonical.com
State Accepted
Headers show

Commit Message

Alex Hung Dec. 9, 2015, 7:32 a.m. UTC
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@canonical.com>
---
 src/acpi/fpdt/fpdt.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Colin Ian King Dec. 9, 2015, 7:47 a.m. UTC | #1
On 09/12/15 07:32, Alex Hung wrote:
> 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@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:
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu Dec. 10, 2015, 3:02 a.m. UTC | #2
On 2015年12月09日 15:32, Alex Hung wrote:
> 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@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:
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox

Patch

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: