Skip to content

Commit

Permalink
app/eventdev: check timer adadpters number
Browse files Browse the repository at this point in the history
[ upstream commit 15c19f3 ]

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

Fixes: 98c6292 ("app/eventdev: add options for event timer adapter")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
  • Loading branch information
PavanNikhilesh authored and bluca committed Nov 16, 2020
1 parent 14834a3 commit 82091c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/test-eventdev/evt_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 82091c3

Please sign in to comment.