From f9d5da4ab686b331c55bb98f43237d64ab820d0b Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Thu, 16 Apr 2020 11:04:45 +0800 Subject: [PATCH] net/tap: fix file close on remove 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 Reviewed-by: Ferruh Yigit Acked-by: Stephen Hemminger --- drivers/net/tap/rte_eth_tap.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 2846ce0d3e..41ea54888e 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -2450,10 +2450,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; } -- 2.20.1