dsddump: fix Package loop condition
diff mbox series

Message ID 20190531134639.23172-1-ernunes@redhat.com
State Accepted
Headers show
Series
  • dsddump: fix Package loop condition
Related show

Commit Message

Erico Nunes May 31, 2019, 1:46 p.m. UTC
Fix the loop condition on the dsddump test.
Without this, dsddump segfaults fwts on platforms with a _DSD.

Signed-off-by: Erico Nunes <ernunes@redhat.com>
---
 src/acpi/dsddump/dsddump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin King May 31, 2019, 2:41 p.m. UTC | #1
On 31/05/2019 14:46, Erico Nunes wrote:
> Fix the loop condition on the dsddump test.
> Without this, dsddump segfaults fwts on platforms with a _DSD.
> 
> Signed-off-by: Erico Nunes <ernunes@redhat.com>
> ---
>  src/acpi/dsddump/dsddump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/acpi/dsddump/dsddump.c b/src/acpi/dsddump/dsddump.c
> index 611789b3..1e3c26c1 100644
> --- a/src/acpi/dsddump/dsddump.c
> +++ b/src/acpi/dsddump/dsddump.c
> @@ -87,7 +87,7 @@ static void parse_device_properity(fwts_framework *fw, ACPI_OBJECT *pkg)
>  			ACPI_OBJECT *sub_pkg = &element->Package.Elements[1];
>  			uint32_t j;
>  
> -			for (j = 0; i < sub_pkg->Package.Count; j++)
> +			for (j = 0; j < sub_pkg->Package.Count; j++)
>  				print_package_element(fw, &sub_pkg->Package.Elements[j]);
>  		} else
>  			print_package_element(fw, &element->Package.Elements[1]);
> 
Good catch. Thanks.

Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung June 3, 2019, 1:10 a.m. UTC | #2
On 2019-05-31 6:46 a.m., Erico Nunes wrote:
> Fix the loop condition on the dsddump test.
> Without this, dsddump segfaults fwts on platforms with a _DSD.
> 
> Signed-off-by: Erico Nunes <ernunes@redhat.com>
> ---
>  src/acpi/dsddump/dsddump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/acpi/dsddump/dsddump.c b/src/acpi/dsddump/dsddump.c
> index 611789b3..1e3c26c1 100644
> --- a/src/acpi/dsddump/dsddump.c
> +++ b/src/acpi/dsddump/dsddump.c
> @@ -87,7 +87,7 @@ static void parse_device_properity(fwts_framework *fw, ACPI_OBJECT *pkg)
>  			ACPI_OBJECT *sub_pkg = &element->Package.Elements[1];
>  			uint32_t j;
>  
> -			for (j = 0; i < sub_pkg->Package.Count; j++)
> +			for (j = 0; j < sub_pkg->Package.Count; j++)
>  				print_package_element(fw, &sub_pkg->Package.Elements[j]);
>  		} else
>  			print_package_element(fw, &element->Package.Elements[1]);
> 


Acked-by: Alex Hung <alex.hung@canonical.com>

Patch
diff mbox series

diff --git a/src/acpi/dsddump/dsddump.c b/src/acpi/dsddump/dsddump.c
index 611789b3..1e3c26c1 100644
--- a/src/acpi/dsddump/dsddump.c
+++ b/src/acpi/dsddump/dsddump.c
@@ -87,7 +87,7 @@  static void parse_device_properity(fwts_framework *fw, ACPI_OBJECT *pkg)
 			ACPI_OBJECT *sub_pkg = &element->Package.Elements[1];
 			uint32_t j;
 
-			for (j = 0; i < sub_pkg->Package.Count; j++)
+			for (j = 0; j < sub_pkg->Package.Count; j++)
 				print_package_element(fw, &sub_pkg->Package.Elements[j]);
 		} else
 			print_package_element(fw, &element->Package.Elements[1]);