diff mbox series

[kvm-unit-tests,04/10] s390x: topology: Fix parsing loop

Message ID 20231020144900.2213398-5-nsg@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: topology: Fixes and extension | expand

Commit Message

Nina Schoetterl-Glausch Oct. 20, 2023, 2:48 p.m. UTC
Without a comparison the loop is infinite.

Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
---
 s390x/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Janosch Frank Oct. 25, 2023, noon UTC | #1
On 10/20/23 16:48, Nina Schoetterl-Glausch wrote:
> Without a comparison the loop is infinite.
> 
> Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
> Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>

Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
diff mbox series

Patch

diff --git a/s390x/topology.c b/s390x/topology.c
index 032e80dc..c8ad4bcb 100644
--- a/s390x/topology.c
+++ b/s390x/topology.c
@@ -468,7 +468,7 @@  static void parse_topology_args(int argc, char **argv)
 		if (flag[0] != '-')
 			report_abort("Argument is expected to begin with '-'");
 		flag++;
-		for (level = 0; ARRAY_SIZE(levels); level++) {
+		for (level = 0; level < ARRAY_SIZE(levels); level++) {
 			if (!strcmp(levels[level], flag))
 				break;
 		}