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 B8C6C41CFD; Tue, 21 Feb 2023 12:15:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4ACB1431C8; Tue, 21 Feb 2023 12:15:01 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 883F3406A2 for ; Tue, 21 Feb 2023 12:14:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676978099; x=1708514099; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=TIgh54FkUtz8fbZ+EeNEPD/UF+Y1wRlkU59ZwA/HcWA=; b=Xp77qEVwVK3u6GYaK0gg+M9jS9+9g6cEGgLmGnxgo9ILRQGtuH0cVoFT coUVMHSzFw5cwB0aTgiig451aPcAEi2BzlcHXT/2TgQ1eyFUM2cPPSvo+ Uh04thIDCYNNiCeFmtRonaGBNDnEc5DD7noxQbhQx5vybyl31VwB1ok5T 1sK0x38AFhWwcV0s8kRJL8hYIpNG+edm4TJUi4V5IDe0V+MQ6vTQ7Q14z E3VXGXsMALVXR+cpHkArhpQCJyIb7TNm3nKCx4AjWytcPYVADPwF2qQs3 DZDb9my5mU3vzB8wgdzlvwvmcgdn8BZN0noAJywbIoDhyfv+LomNvlrBq w==; X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="360074714" X-IronPort-AV: E=Sophos;i="5.97,315,1669104000"; d="scan'208";a="360074714" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2023 03:14:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="649137509" X-IronPort-AV: E=Sophos;i="5.97,315,1669104000"; d="scan'208";a="649137509" Received: from silpixa00400899.ir.intel.com ([10.243.22.64]) by orsmga006.jf.intel.com with ESMTP; 21 Feb 2023 03:14:56 -0800 From: Shibin Koikkara Reeny To: dev@dpdk.org, qi.z.zhang@intel.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, john.mcnamara@intel.com Cc: ciara.loftus@intel.com, Shibin Koikkara Reeny Subject: [PATCH] net/af_xdp: fix integer handling issues Date: Tue, 21 Feb 2023 11:14:26 +0000 Message-Id: <20230221111426.172357-1-shibin.koikkara.reeny@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 Fix integer handling issues (NEGATIVE_RETURNS) reported in coverity scan. Add a check to sock variable if the value is negative return -1. Coverity issue: 383245 Fixes: 7fc6ae50369d ("net/af_xdp: support CNI Integration") Signed-off-by: Shibin Koikkara Reeny --- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index 02c874d51e..2a20a6960c 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -1508,6 +1508,8 @@ get_cni_fd(char *if_name) memset(&server, 0, sizeof(server)); sock = init_uds_sock(&server); + if (sock < 0) + return -1; /* Initiates handshake to CNI send: /connect,hostname */ snprintf(request, sizeof(request), "%s,%s", UDS_CONNECT_MSG, hostname); -- 2.25.1