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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Feb 11 12:20:10 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.1

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.

Thanks.

Luca Boccassi

---
>From 8991c00f7b7237636bf91277ebb4cb0a16f4a8b9 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 ea016e85d8..ffbaa75b7e 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -537,7 +537,8 @@ virtio_user_dev_uninit(struct virtio_user_dev *dev)
 		close(dev->kickfds[i]);
 	}
 
-	close(dev->vhostfd);
+	if (dev->vhostfd >= 0)
+		close(dev->vhostfd);
 
 	if (dev->is_server && dev->listenfd >= 0) {
 		close(dev->listenfd);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-11 11:17:41.255809396 +0000
+++ 0064-net-virtio-user-check-file-descriptor-before-closing.patch	2020-02-11 11:17:38.456002394 +0000
@@ -1,13 +1,14 @@
-From b56c12acf20585ad46faf9455b4b9aeb30450ef0 Mon Sep 17 00:00:00 2001
+From 8991c00f7b7237636bf91277ebb4cb0a16f4a8b9 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")
-Cc: stable at dpdk.org
 
 Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
 Reviewed-by: Tiwei Bie <tiwei.bie at intel.com>


More information about the stable mailing list