[v4,4/5] net/tap: fix close a valid fd
Checks
Commit Message
From: Yunjian Wang <wangyunjian@huawei.com>
The internal structure is freed and set to NULL in the
rte_eth_dev_release_port() and zero is a valid fd. Ultimately
leads to a valid fd was closed by mistake.
Fixes: 3101191c63ab ("net/tap: fix device removal when no queue exist")
CC: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
drivers/net/tap/rte_eth_tap.c | 4 ----
1 file changed, 4 deletions(-)
Comments
On 4/11/2020 12:24 PM, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> The internal structure is freed and set to NULL in the
> rte_eth_dev_release_port() and zero is a valid fd. Ultimately
> leads to a valid fd was closed by mistake.
>
> Fixes: 3101191c63ab ("net/tap: fix device removal when no queue exist")
> CC: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
@@ -2447,10 +2447,6 @@ rte_pmd_tap_remove(struct rte_vdev_device *dev)
tap_devices_count--;
rte_eth_dev_release_port(eth_dev);
- if (internals->ka_fd != -1) {
- close(internals->ka_fd);
- internals->ka_fd = -1;
- }
return 0;
}