patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jiawei Zhu <17826875952@163.com>
To: zhujiawei12@huawei.com
Cc: stable@dpdk.org
Subject: [dpdk-stable] [PATCH] net/virtio-user: fix error run close(0)
Date: Sat, 28 Nov 2020 03:32:35 +0800	[thread overview]
Message-ID: <1606505555-31837-1-git-send-email-17826875952@163.com> (raw)

From: Jiawei Zhu <zhujiawei12@huawei.com>

When i < VIRTIO_MAX_VIRTQUEUES and j == i,
dev->callfds[i] and dev->kickfds[i] are default 0.
So it will close(0), close the standard input (stdin).

Fixes: e6e7ad8b3024 ("net/virtio-user: move eventfd open/close into init/uninit")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Zhu <zhujiawei12@huawei.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 053f026..1bfd223 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -284,7 +284,7 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
 	}
 
 	if (i < VIRTIO_MAX_VIRTQUEUES) {
-		for (j = 0; j <= i; ++j) {
+		for (j = 0; j < i; ++j) {
 			close(dev->callfds[j]);
 			close(dev->kickfds[j]);
 		}
-- 
1.8.3.1


             reply	other threads:[~2020-11-30 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27 19:32 Jiawei Zhu [this message]
     [not found] <1606575020-2973-1-git-send-email-17826875952@163.com>
2020-12-09 11:31 ` Xia, Chenbo
2020-12-09 11:33   ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1606505555-31837-1-git-send-email-17826875952@163.com \
    --to=17826875952@163.com \
    --cc=stable@dpdk.org \
    --cc=zhujiawei12@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).