From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 90E38A0350; Tue, 22 Feb 2022 14:19:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 162AF41143; Tue, 22 Feb 2022 14:19:00 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 71BD840E64 for ; Tue, 22 Feb 2022 14:18:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645535938; x=1677071938; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=Nz1pKBx75URpb0XxP+243lu4T9ZHDCPcFO7rRYGlhBs=; b=BB2EFRDOjEzcAXpKHYjD1SDFbVFRf0jh3e2s/sH4m8yHcDb4GpRUuA9W tuD7pcRyMk4aPvpwqwdJa1YcvzCenqvKpDtR/h9G2MRh3SkcR2DMI7kbn w4IpaR4+hG91Nnye86nc6YMkhwJhcg36G52VXa/3NmU4MR/8UIQGSl+Qj vWvwXExT8j1z7eRcngp2xGdtKfCyLWmsdxo73qI4HVwy/s73H99LLftaR zh+3DwBnHo17JL2FSwDHMSndedH6ai/2GxPVJAXrJsZlxiVUubx/XgOKT vrZhgKwmNg1fU8tJeDrmZepUcWUwlYYHYRFcVvuR3zjMVikxHItjGHcz9 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="276300200" X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="276300200" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2022 05:18:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="638899443" Received: from silpixa00397515.ir.intel.com (HELO silpixa00397515.ger.corp.intel.com) ([10.237.222.51]) by orsmga004.jf.intel.com with ESMTP; 22 Feb 2022 05:18:56 -0800 From: Megha Ajmera To: dev@dpdk.org, sham.singh.thakur@intel.com, stephen@networkplumber.org, john.mcnamara@intel.com Subject: [PATCH] sched: fix integer handling issue Date: Tue, 22 Feb 2022 13:18:51 +0000 Message-Id: <20220222131851.2944637-1-megha.ajmera@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Masking of core mask was incorrect. Instead of using 1U for shifting, it should be using 1LU as the result is assigned to uint64. CID 375859: Potentially overflowing expression "1U << app_main_core" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned). Coverity issue: 375859 Signed-off-by: Megha Ajmera --- examples/qos_sched/args.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index 10ca7bea61..44f2f5640e 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -433,7 +433,7 @@ app_parse_args(int argc, char **argv) return -1; } } - app_used_core_mask |= 1u << app_main_core; + app_used_core_mask |= 1lu << app_main_core; if ((app_used_core_mask != app_eal_core_mask()) || (app_main_core != rte_get_main_lcore())) { -- 2.25.1