From: <pbhagavatula@marvell.com>
To: <jerinj@marvell.com>
Cc: <dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>,
<stable@dpdk.org>
Subject: [dpdk-dev] [PATCH] app/eventdev: fix segfault with incorrect timer adadpters
Date: Thu, 12 Nov 2020 23:13:29 +0530 [thread overview]
Message-ID: <20201112174330.313-1-pbhagavatula@marvell.com> (raw)
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
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>
---
app/test-eventdev/evt_options.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c
index 6994ac453..6aeab8257 100644
--- a/app/test-eventdev/evt_options.c
+++ b/app/test-eventdev/evt_options.c
@@ -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 cant be <= 0");
+ return -EINVAL;
+ }
return ret;
}
--
2.17.1
next reply other threads:[~2020-11-12 17:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 17:43 pbhagavatula [this message]
2020-11-13 9:56 ` Jerin Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201112174330.313-1-pbhagavatula@marvell.com \
--to=pbhagavatula@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).