From: Ferruh Yigit Date: Sun, 28 Oct 2018 01:46:50 +0000 (+0000) Subject: ethdev: fix redundant function pointer check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;ds=sidebyside;h=11745065a5b98957dc834b04a3b175c62ae8a70b;p=dpdk.git ethdev: fix redundant function pointer check 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 Acked-by: Thomas Monjalon --- diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 9d34813892..36e5389b3a 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); }