From: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
To: dev@dpdk.org
Cc: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Subject: [dpdk-dev] [PATCH] examples/exception_path: fix shift operation in lcore setup
Date: Wed, 3 Aug 2016 13:44:11 +0200 [thread overview]
Message-ID: <1470224651-105433-1-git-send-email-danielx.t.mrzyglod@intel.com> (raw)
The operaton may have an undefined behavior or yield to an unexpected result.
A bit shift operation has a shift amount which is too large or has a negative value.
Coverity issue: 30688
Fixes: ea977ff1cb0b ("examples/exception_path: fix shift operation in lcore setup")
The previous patch forget to fix values also for input_cores_mask
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
---
examples/exception_path/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index e5eedcc..88e7708 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -341,7 +341,7 @@ setup_port_lcore_affinities(void)
/* Setup port_ids[] array, and check masks were ok */
RTE_LCORE_FOREACH(i) {
- if (input_cores_mask & (1ULL << i)) {
+ if (input_cores_mask & (1ULL << (i & 0x3f))) {
/* Skip ports that are not enabled */
while ((ports_mask & (1 << rx_port)) == 0) {
rx_port++;
--
2.7.4
next reply other threads:[~2016-08-03 10:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-03 11:44 Daniel Mrzyglod [this message]
2016-08-04 9:02 ` Ferruh Yigit
2016-08-09 12:37 ` [dpdk-dev] [PATCH v2] " Daniel Mrzyglod
2016-09-11 12:38 ` Yuanhan Liu
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=1470224651-105433-1-git-send-email-danielx.t.mrzyglod@intel.com \
--to=danielx.t.mrzyglod@intel.com \
--cc=dev@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).