ethdev: fix redundant function pointer check
Checks
Commit Message
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>
---
lib/librte_ethdev/rte_ethdev.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
Comments
28/10/2018 02:46, Ferruh Yigit:
> 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>
On 10/28/2018 9:43 AM, Thomas Monjalon wrote:
> 28/10/2018 02:46, Ferruh Yigit:
>> 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>
Applied to dpdk-next-net/master, thanks.
@@ -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);
}