From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6BE9FA0588 for ; Thu, 16 Apr 2020 05:05:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5171E1DA6E; Thu, 16 Apr 2020 05:05:04 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id 9BBF11DA26; Thu, 16 Apr 2020 05:05:01 +0200 (CEST) Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 37FCCFFB4DA95C33A9B8; Thu, 16 Apr 2020 11:05:00 +0800 (CST) Received: from localhost (10.173.251.152) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Thu, 16 Apr 2020 11:04:49 +0800 From: wangyunjian To: , CC: , , , Yunjian Wang , Date: Thu, 16 Apr 2020 11:04:45 +0800 Message-ID: <1587006285-21604-1-git-send-email-wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.173.251.152] X-CFilter-Loop: Reflected Subject: [dpdk-stable] [dpdk-dev] [PATCH v5 4/5] net/tap: fix close a valid fd X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Yunjian Wang 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 Reviewed-by: Ferruh Yigit Signed-off-by: Yunjian Wang --- 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 576055e16..eab1fb771 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -2451,10 +2451,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.19.1