diff mbox series

[2/3] test/latencystats: fix incorrect loop boundary

Message ID 20210917082313.21934-3-david.marchand@redhat.com (mailing list archive)
State Superseded
Delegated to: David Marchand
Headers show
Series Experiment ASAN in GHA | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand Sept. 17, 2021, 8:23 a.m. UTC
Caught running ASAN.

lat_stats_strings[] is an array containing NUM_STATS strings.

Fixes: 1e3676a06e4c ("test/latency: add unit tests for latencystats library")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_latencystats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pattan, Reshma Sept. 20, 2021, 8:51 a.m. UTC | #1
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Caught running ASAN.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Acked-by:  Reshma Pattan <reshma.pattan@intel.com>
diff mbox series

Patch

diff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c
index 427339904d..724acbc315 100644
--- a/app/test/test_latencystats.c
+++ b/app/test/test_latencystats.c
@@ -80,7 +80,7 @@  static int test_latencystats_get_names(void)
 	/* Success Test: Valid names and size */
 	size = NUM_STATS;
 	ret = rte_latencystats_get_names(names, size);
-	for (i = 0; i <= NUM_STATS; i++) {
+	for (i = 0; i < NUM_STATS; i++) {
 		if (strcmp(lat_stats_strings[i].name, names[i].name) == 0)
 			printf(" %s\n", names[i].name);
 		else