[dpdk-stable] patch 'net/virtio-user: check file descriptor before closing' has been queued to LTS release 18.11.7

Kevin Traynor ktraynor at redhat.com
Fri Feb 7 16:12:38 CET 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/13/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/a3f5b5bbf79af44738fa2dafefaaa09409418f3e

Thanks.

Kevin.

---
>From a3f5b5bbf79af44738fa2dafefaaa09409418f3e Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Mon, 6 Jan 2020 11:18:37 -0800
Subject: [PATCH] net/virtio-user: check file descriptor before closing

[ upstream commit b56c12acf20585ad46faf9455b4b9aeb30450ef0 ]

Valgrind complains that virtio_user is calling close(-1).
Fix this by adding check in virtio that is similar to existing code.

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Reviewed-by: Tiwei Bie <tiwei.bie at intel.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 ++-
 1 file changed, 2 insertions(+), 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 91536c667a..f6356eabc6 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -525,5 +525,6 @@ virtio_user_dev_uninit(struct virtio_user_dev *dev)
 	}
 
-	close(dev->vhostfd);
+	if (dev->vhostfd >= 0)
+		close(dev->vhostfd);
 
 	if (dev->is_server && dev->listenfd >= 0) {
-- 
2.21.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-07 15:08:18.877065267 +0000
+++ 0026-net-virtio-user-check-file-descriptor-before-closing.patch	2020-02-07 15:08:17.544062551 +0000
@@ -1 +1 @@
-From b56c12acf20585ad46faf9455b4b9aeb30450ef0 Mon Sep 17 00:00:00 2001
+From a3f5b5bbf79af44738fa2dafefaaa09409418f3e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b56c12acf20585ad46faf9455b4b9aeb30450ef0 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index ea016e85d8..ffbaa75b7e 100644
+index 91536c667a..f6356eabc6 100644
@@ -22 +23 @@
-@@ -538,5 +538,6 @@ virtio_user_dev_uninit(struct virtio_user_dev *dev)
+@@ -525,5 +525,6 @@ virtio_user_dev_uninit(struct virtio_user_dev *dev)



More information about the stable mailing list