[dpdk-stable] patch 'net/virtio: fix getline memory leakage' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Sat Jun 12 01:02:12 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/14/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/0f0469489b1a11ac46975e2b53f5ff8d42692446

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 0f0469489b1a11ac46975e2b53f5ff8d42692446 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Wed, 21 Apr 2021 09:37:49 +0800
Subject: [PATCH] net/virtio: fix getline memory leakage
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 9f528374bffb5868ec6bf896f57919a709b31911 ]

This patch fixes getline memory leakage when parsing dynamic major num.

Fixes: 7d62bf6f54ba ("net/virtio: introduce vhost-vDPA backend type")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
---
 drivers/net/virtio/virtio_user_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 45edd2ae60..0906a34799 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -584,7 +584,7 @@ vdpa_dynamic_major_num(void)
 {
 	FILE *fp;
 	char *line = NULL;
-	size_t size;
+	size_t size = 0;
 	char name[11];
 	bool found = false;
 	uint32_t num;
@@ -604,6 +604,7 @@ vdpa_dynamic_major_num(void)
 			break;
 		}
 	}
+	free(line);
 	fclose(fp);
 	return found ? num : UNNAMED_MAJOR;
 }
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-06-12 06:53:57.654376500 +0800
+++ 0038-net-virtio-fix-getline-memory-leakage.patch	2021-06-12 06:53:56.190000000 +0800
@@ -1 +1 @@
-From 9f528374bffb5868ec6bf896f57919a709b31911 Mon Sep 17 00:00:00 2001
+From 0f0469489b1a11ac46975e2b53f5ff8d42692446 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 9f528374bffb5868ec6bf896f57919a709b31911 ]
@@ -9 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +21 @@
-index 79bd31ed82..e85906e9eb 100644
+index 45edd2ae60..0906a34799 100644
@@ -22 +24 @@
-@@ -360,7 +360,7 @@ vdpa_dynamic_major_num(void)
+@@ -584,7 +584,7 @@ vdpa_dynamic_major_num(void)
@@ -31 +33 @@
-@@ -380,6 +380,7 @@ vdpa_dynamic_major_num(void)
+@@ -604,6 +604,7 @@ vdpa_dynamic_major_num(void)


More information about the stable mailing list