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 4123CA04E0; Thu, 28 Nov 2019 11:03:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1C6692BF9; Thu, 28 Nov 2019 11:03:44 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id D7EF52BF9 for ; Thu, 28 Nov 2019 11:03:42 +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 orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2019 02:03:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,253,1571727600"; d="scan'208";a="383780635" Received: from silpixa00399416.ir.intel.com (HELO silpixa00399416.ger.corp.intel.com) ([10.237.223.137]) by orsmga005.jf.intel.com with ESMTP; 28 Nov 2019 02:03:41 -0800 From: Praveen Shetty To: dev@dpdk.org Cc: bruce.richardson@intel.com Date: Thu, 28 Nov 2019 10:03:25 +0000 Message-Id: <20191128100325.25003-2-praveen.shetty@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128100325.25003-1-praveen.shetty@intel.com> References: <20191128100325.25003-1-praveen.shetty@intel.com> Subject: [dpdk-dev] [PATCH] examples/ioat: 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" patch checks the return value of function rte_eth_dev_info_get, if return value is negative error message printed on the console. Coverity issue: 350361 Signed-off-by: Praveen Shetty --- examples/ioat/ioatfwd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c index e9117718f..b39a098ec 100644 --- a/examples/ioat/ioatfwd.c +++ b/examples/ioat/ioatfwd.c @@ -824,7 +824,11 @@ 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, "Cannot get device info: %s, port=%u\n", + rte_strerror(-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