* [dpdk-dev] [PATCH] net/virtio-user: fix tapfds close issue
@ 2017-03-13 9:33 Wenfeng Liu
2017-03-14 6:22 ` Yuanhan Liu
0 siblings, 1 reply; 2+ messages in thread
From: Wenfeng Liu @ 2017-03-13 9:33 UTC (permalink / raw)
To: yuanhan.liu, maxime.coquelin; +Cc: dev
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 <liuwf@arraynetworks.com.cn>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-14 6:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 9:33 [dpdk-dev] [PATCH] net/virtio-user: fix tapfds close issue Wenfeng Liu
2017-03-14 6:22 ` Yuanhan Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).