From patchwork Thu Nov 28 11:27:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Shetty, Praveen" X-Patchwork-Id: 63375 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 85E9FA04E0; Thu, 28 Nov 2019 12:27:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B9B53293C; Thu, 28 Nov 2019 12:27:24 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id B183F28EE for ; Thu, 28 Nov 2019 12:27:22 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2019 03:27:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,253,1571727600"; d="scan'208";a="199498787" Received: from silpixa00399416.ir.intel.com (HELO silpixa00399416.ger.corp.intel.com) ([10.237.223.137]) by orsmga007.jf.intel.com with ESMTP; 28 Nov 2019 03:27:20 -0800 From: Praveen Shetty To: dev@dpdk.org Cc: bruce.richardson@intel.com, pawelx.modrak@intel.com Date: Thu, 28 Nov 2019 11:27:14 +0000 Message-Id: <20191128112715.26283-1-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 v2] 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 Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver") Cc: pawelx.modrak@intel.com Signed-off-by: Praveen Shetty Acked-by: Bruce Richardson --- 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)