event/cnxk: fix out of bounds access in test

Fix out of bounds array access reported in coverity scan.

Coverity issue: 375817
Fixes: 2351506401 ("event/cnxk: add SSO selftest and dump")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Gowrishankar Muthukrishnan 2022-04-24 21:54:55 +05:30 committed by Jerin Jacob
parent 86fe66d456
commit 2f5b0c4862

View File

@ -626,6 +626,12 @@ launch_workers_and_wait(int (*main_thread)(void *),
/* start core */ -1,
/* skip main */ 1,
/* wrap */ 0);
if (w_lcore == RTE_MAX_LCORE) {
plt_err("Failed to get next available lcore");
free(param);
return -1;
}
rte_eal_remote_launch(main_thread, &param[0], w_lcore);
for (port = 1; port < nb_workers; port++) {
@ -635,6 +641,12 @@ launch_workers_and_wait(int (*main_thread)(void *),
param[port].dequeue_tmo_ticks = dequeue_tmo_ticks;
rte_atomic_thread_fence(__ATOMIC_RELEASE);
w_lcore = rte_get_next_lcore(w_lcore, 1, 0);
if (w_lcore == RTE_MAX_LCORE) {
plt_err("Failed to get next available lcore");
free(param);
return -1;
}
rte_eal_remote_launch(worker_thread, &param[port], w_lcore);
}