From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id C1D242B94; Sun, 28 Oct 2018 02:47:08 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Oct 2018 17:47:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,434,1534834800"; d="scan'208";a="95580261" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.212]) by orsmga003.jf.intel.com with ESMTP; 27 Oct 2018 17:47:05 -0700 From: Ferruh Yigit To: Thomas Monjalon , Andrew Rybchenko Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org Date: Sun, 28 Oct 2018 01:46:50 +0000 Message-Id: <20181028014650.84308-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.17.2 Subject: [dpdk-dev] [PATCH] ethdev: fix redundant function pointer check 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: , X-List-Received-Date: Sun, 28 Oct 2018 00:47:09 -0000 RTE_FUNC_PTR_OR_ERR_RET() already does the `ethdev_uninit` NULL check. Fixes: e489007a411c ("ethdev: add generic create/destroy ethdev APIs") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- lib/librte_ethdev/rte_ethdev.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index b2ac590ae..219795e41 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -3647,11 +3647,10 @@ rte_eth_dev_destroy(struct rte_eth_dev *ethdev, return -ENODEV; RTE_FUNC_PTR_OR_ERR_RET(*ethdev_uninit, -EINVAL); - if (ethdev_uninit) { - ret = ethdev_uninit(ethdev); - if (ret) - return ret; - } + + ret = ethdev_uninit(ethdev); + if (ret) + return ret; return rte_eth_dev_release_port(ethdev); } -- 2.17.2