From 11745065a5b98957dc834b04a3b175c62ae8a70b Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Sun, 28 Oct 2018 01:46:50 +0000 Subject: [PATCH] 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 --- 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 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); } -- 2.20.1