net/tap: fix file close on remove
authorYunjian Wang <wangyunjian@huawei.com>
Thu, 16 Apr 2020 03:04:45 +0000 (11:04 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:08 +0000 (13:57 +0200)
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>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/tap/rte_eth_tap.c

index 2846ce0..41ea548 100644 (file)
@@ -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;
 }