From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail01.arraynetworks.com.cn (mail.arraynetworks.com.cn [124.42.99.121]) by dpdk.org (Postfix) with ESMTP id 9E4E33B5 for ; Mon, 13 Mar 2017 10:33:27 +0100 (CET) Received: from localhost.localdomain.localdomain (192.168.4.200) by mail01.arraynetworks.com.cn (10.3.0.251) with Microsoft SMTP Server id 14.3.123.3; Mon, 13 Mar 2017 17:30:45 +0800 From: Wenfeng Liu To: , CC: Date: Mon, 13 Mar 2017 09:33:21 +0000 Message-ID: <1489397601-2986-1-git-send-email-liuwf@arraynetworks.com.cn> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.4.200] Subject: [dpdk-dev] [PATCH] net/virtio-user: fix tapfds close issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Mar 2017 09:33:28 -0000 The valid tap file descriptor range should be equal or greater than zero instead of non-zero Fixes: e3b434818bbb ("net/virtio-user: support kernel vhost") Signed-off-by: Wenfeng Liu --- drivers/net/virtio/virtio_user/vhost_kernel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user/vhost_kernel.c b/drivers/net/virtio/virtio_user/vhost_kernel.c index 05aa6c6..68d28b1 100644 --- a/drivers/net/virtio/virtio_user/vhost_kernel.c +++ b/drivers/net/virtio/virtio_user/vhost_kernel.c @@ -365,7 +365,7 @@ struct vhost_memory_kernel { vhostfd = dev->vhostfds[pair_idx]; if (!enable) { - if (dev->tapfds[pair_idx]) { + if (dev->tapfds[pair_idx] >= 0) { close(dev->tapfds[pair_idx]); dev->tapfds[pair_idx] = -1; } -- 1.8.3.1