app/eventdev: check timer adadpters number

Fix SEGFAULT when nb_timer_adapters command line parameter is
set to 0.

Fixes: 98c6292105d4 ("app/eventdev: add options for event timer adapter")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
This commit is contained in:
Pavan Nikhilesh 2020-11-12 23:13:29 +05:30 committed by Jerin Jacob
parent edbebd334a
commit 15c19f36f5

View File

@ -197,6 +197,10 @@ evt_parse_nb_timer_adptrs(struct evt_options *opt, const char *arg)
int ret;
ret = parser_read_uint8(&(opt->nb_timer_adptrs), arg);
if (opt->nb_timer_adptrs <= 0) {
evt_err("Number of timer adapters cannot be <= 0");
return -EINVAL;
}
return ret;
}