Skip to content

Commit

Permalink
event/cnxk: fix out of bounds access in test
Browse files Browse the repository at this point in the history
[ upstream commit 2f5b0c4 ]

Fix out of bounds array access reported in coverity scan.

Coverity issue: 375817
Fixes: 2351506 ("event/cnxk: add SSO selftest and dump")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
Gowrishankar Muthukrishnan authored and kevintraynor committed May 25, 2022
1 parent 09d8595 commit eeaeb58
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/event/cnxk/cnxk_eventdev_selftest.c
Expand Up @@ -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++) {
Expand All @@ -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);
}

Expand Down

0 comments on commit eeaeb58

Please sign in to comment.