On Sun, Apr 24, 2022 at 9:55 PM Gowrishankar Muthukrishnan
<gmuthukri...@marvell.com> wrote:
>
> Fix out of bounds array access reporrted in coverity scan.

Fixed reported  typo

>
> Coverity issue: 375817
> Fixes: 2351506401e ("event/cnxk: add SSO selftest and dump")
>
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukri...@marvell.com>

Acked-by: Jerin Jacob <jer...@marvell.com>

Applied to dpdk-next-net-eventdev/for-main. Thanks

> ---
>  drivers/event/cnxk/cnxk_eventdev_selftest.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/event/cnxk/cnxk_eventdev_selftest.c 
> b/drivers/event/cnxk/cnxk_eventdev_selftest.c
> index 2fe6467f88..3aa6f081a7 100644
> --- a/drivers/event/cnxk/cnxk_eventdev_selftest.c
> +++ b/drivers/event/cnxk/cnxk_eventdev_selftest.c
> @@ -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);
>         }
>
> --
> 2.25.1
>

Reply via email to