From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2CE15FE5 for ; Wed, 3 Aug 2016 12:44:51 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 03 Aug 2016 03:44:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,465,1464678000"; d="scan'208";a="1034250052" Received: from gklab-246-025.igk.intel.com (HELO Sent) ([10.217.246.25]) by fmsmga002.fm.intel.com with SMTP; 03 Aug 2016 03:44:49 -0700 Received: by Sent (sSMTP sendmail emulation); Wed, 03 Aug 2016 13:44:13 +0200 From: Daniel Mrzyglod To: dev@dpdk.org Cc: Daniel Mrzyglod Date: Wed, 3 Aug 2016 13:44:11 +0200 Message-Id: <1470224651-105433-1-git-send-email-danielx.t.mrzyglod@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] examples/exception_path: fix shift operation in lcore setup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2016 10:44:51 -0000 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 --- 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