summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFerruh Yigit <ferruh.yigit@intel.com>2018-10-28 01:46:50 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-11-05 15:01:25 +0100
commit11745065a5b98957dc834b04a3b175c62ae8a70b (patch)
tree57db059b66ec3975d02b63b76dc6566efaa4ef19 /lib
parent708e14d8b9acfa4669d75d42d0c56537e02c2f04 (diff)
downloaddpdk-11745065a5b98957dc834b04a3b175c62ae8a70b.zip
dpdk-11745065a5b98957dc834b04a3b175c62ae8a70b.tar.gz
dpdk-11745065a5b98957dc834b04a3b175c62ae8a70b.tar.xz
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 <ferruh.yigit@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_ethdev/rte_ethdev.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 9d34813..36e5389 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);
}