DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio-user: fix error run close(0)
@ 2020-11-28 14:50 Jiawei Zhu
  2020-12-09 11:31 ` Xia, Chenbo
  0 siblings, 1 reply; 7+ messages in thread
From: Jiawei Zhu @ 2020-11-28 14:50 UTC (permalink / raw)
  To: dev; +Cc: liweifeng2, zhujiawei12, maxime.coquelin, chenbo.xia

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


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH] net/virtio-user: fix error run close(0)
@ 2020-12-09  7:34 17826875952
  0 siblings, 0 replies; 7+ messages in thread
From: 17826875952 @ 2020-12-09  7:34 UTC (permalink / raw)
  To: dev; +Cc: liweifeng2, zhujiawei12, maxime.coquelin, chenbo.xia

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

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH] net/virtio-user: fix error run close(0)
@ 2020-11-27 19:38 Jiawei Zhu
  0 siblings, 0 replies; 7+ messages in thread
From: Jiawei Zhu @ 2020-11-27 19:38 UTC (permalink / raw)
  To: dev; +Cc: liweifeng2, zhujiawei12, songyujin, chas3, xavier.huawei

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-12-11 21:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-28 14:50 [dpdk-dev] [PATCH] net/virtio-user: fix error run close(0) Jiawei Zhu
2020-12-09 11:31 ` Xia, Chenbo
2020-12-09 11:33   ` Maxime Coquelin
     [not found]   ` <4a6e80c5.31.1764db4afc6.Coremail.17826875952@163.com>
2020-12-11  1:58     ` Xia, Chenbo
2020-12-11 21:35       ` 17826875952
  -- strict thread matches above, loose matches on Subject: below --
2020-12-09  7:34 17826875952
2020-11-27 19:38 Jiawei Zhu

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).