Skip to contentSkip to conversation

ethdev: fix redundant function pointer check

PATCH In review Ferruh Yigit 2 participants 3 messages Oct 28, 2018 – Nov 2, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 lib/librte_ethdev/rte_ethdev.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
lib/librte_ethdev/rte_ethdev.c +4 -5
index b2ac590ae..219795e41 100644
@@ -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);
 }
Signature · 1 line
2.17.2