From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0F25A04DD; Wed, 27 Nov 2019 19:04:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D6D471BEA6; Wed, 27 Nov 2019 19:04:49 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id E55D74C9D for ; Wed, 27 Nov 2019 13:03:47 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2019 04:03:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,249,1571727600"; d="scan'208";a="383483524" Received: from silpixa00390845.ir.intel.com (HELO silpixa00390845.ger.corp.intel.com) ([10.237.223.208]) by orsmga005.jf.intel.com with ESMTP; 27 Nov 2019 04:03:45 -0800 From: Shashank T D To: dev@dpdk.org Cc: xiaoyun.li@intel.com Date: Wed, 27 Nov 2019 12:03:41 +0000 Message-Id: <20191127120341.2845-1-shashank.t.d@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191127103359.1957-1-shashank.t.d@intel.com> References: <20191127103359.1957-1-shashank.t.d@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 27 Nov 2019 19:04:46 +0100 Subject: [dpdk-dev] [PATCH v2] examples/tep_termination: resolve unchecked return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" This patch checked the return value of rte_eth_dev_info_get function. Coverity issue: 349922 Signed-off-by: Shashank T D --- examples/tep_termination/vxlan_setup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c index eca119a72..384b3167e 100644 --- a/examples/tep_termination/vxlan_setup.c +++ b/examples/tep_termination/vxlan_setup.c @@ -195,7 +195,12 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool) if (tso_segsz != 0) { struct rte_eth_dev_info dev_info; - rte_eth_dev_info_get(port, &dev_info); + retval = rte_eth_dev_info_get(port, &dev_info); + if (retval != 0) + rte_exit(EXIT_FAILURE, + "Error during getting device (port %u) info: %s\n", + port, strerror(-retval)); + if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) == 0) RTE_LOG(WARNING, PORT, "hardware TSO offload is not supported\n"); -- 2.17.1