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 E7E7DA0535 for ; Tue, 4 Feb 2020 17:13:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D45281C224; Tue, 4 Feb 2020 17:13:03 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id CB9521C205; Tue, 4 Feb 2020 17:13:00 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2020 08:12:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,402,1574150400"; d="scan'208";a="311088013" Received: from silpixa00399953.ir.intel.com (HELO silpixa00399953.ger.corp.intel.com) ([10.237.222.53]) by orsmga001.jf.intel.com with ESMTP; 04 Feb 2020 08:12:57 -0800 From: Ciara Power To: bruce.richardson@intel.com Cc: dev@dpdk.org, Ciara Power , pawelx.modrak@intel.com, stable@dpdk.org Date: Tue, 4 Feb 2020 16:03:09 +0000 Message-Id: <20200204160309.64827-1-ciara.power@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH] examples/ioat: fix unchecked return value X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" The function call to get the device info can return negative values on failure, which was previously unchecked. This return value is now checked and the function exits on failure. Coverity issue: 350361 Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver") Cc: pawelx.modrak@intel.com Cc: stable@dpdk.org Signed-off-by: Ciara Power --- examples/ioat/ioatfwd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c index e9117718f..029f2f0ab 100644 --- a/examples/ioat/ioatfwd.c +++ b/examples/ioat/ioatfwd.c @@ -824,7 +824,10 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool, uint16_t nb_queues) /* Init port */ printf("Initializing port %u... ", portid); fflush(stdout); - rte_eth_dev_info_get(portid, &dev_info); + ret = rte_eth_dev_info_get(portid, &dev_info); + if (ret < 0) + rte_exit(EXIT_FAILURE, "Error during getting device info:" + " err=%d, port=%u\n", ret, portid); local_port_conf.rx_adv_conf.rss_conf.rss_hf &= dev_info.flow_type_rss_offloads; if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) -- 2.17.1