From patchwork Wed Oct 27 02:01:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Wang X-Patchwork-Id: 103002 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30A31A0547; Wed, 27 Oct 2021 04:03:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4FC040E0F; Wed, 27 Oct 2021 04:03:10 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id E921D407FF for ; Wed, 27 Oct 2021 04:03:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10149"; a="230330568" X-IronPort-AV: E=Sophos;i="5.87,184,1631602800"; d="scan'208";a="230330568" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 19:03:07 -0700 X-IronPort-AV: E=Sophos;i="5.87,184,1631602800"; d="scan'208";a="497628212" Received: from dpdk.cd.intel.com ([10.240.178.133]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 19:03:06 -0700 From: Jie Wang To: dev@dpdk.org Cc: orika@nvidia.com, Jie Wang Date: Wed, 27 Oct 2021 10:01:52 +0800 Message-Id: <20211027020152.1928220-1-jie1x.wang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] app/testpmd: fix error definition type 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 Sender: "dev" In "msg_type |= 0xc800", wider "51200" has high-order bits (0xc800) that don't affect the narrower left-hand side. This patch fixs coverity issue by changing the definition type of "msg_type" from uint8_t to uint16_t. Coverity issue: 373651 Fixes: 748530f0354e ("app/testpmd: support L2TPv2 and PPP protocol pattern") Signed-off-by: Jie Wang Reviewed-by: Ferruh Yigit --- app/test-pmd/cmdline_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index d8218771fb..24b224e632 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -5880,7 +5880,7 @@ parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token, struct rte_flow_item_l2tpv2 *l2tpv2_mask; struct rte_flow_item *item; uint32_t data_size; - uint8_t msg_type = 0; + uint16_t msg_type = 0; struct buffer *out = buf; const struct arg *arg;