[dpdk-stable] patch 'eal: fix memory leak when saving arguments' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:28:50 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From fcece17c517b90e30826955e4a6f6f54df2c0e90 Mon Sep 17 00:00:00 2001
From: Conor Walsh <conor.walsh at intel.com>
Date: Wed, 1 Sep 2021 09:38:47 +0000
Subject: [PATCH] eal: fix memory leak when saving arguments
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 4777674c4428f528fa2890d8afab551f6dd54c24 ]

This patch fixes a memleak which was reported in Bugzilla within the
eal_save_args function. This was caused by the function mistakenly
adding -- to the eal args instead of breaking beforehand.

Bugzilla ID: 722
Fixes: 293c53d8b23c ("eal: add telemetry callbacks")

Reported-by: Zhihong Peng <zhihongx.peng at intel.com>
Signed-off-by: Conor Walsh <conor.walsh at intel.com>
Signed-off-by: Conor Fogarty <conor.fogarty at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 lib/librte_eal/common/eal_common_options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index f8ab47435d..977ba21c51 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -228,9 +228,9 @@ eal_save_args(int argc, char **argv)
 		return -1;
 
 	for (i = 0; i < argc; i++) {
-		eal_args[i] = strdup(argv[i]);
 		if (strcmp(argv[i], "--") == 0)
 			break;
+		eal_args[i] = strdup(argv[i]);
 	}
 	eal_args[i++] = NULL; /* always finish with NULL */
 
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:04.159870986 +0800
+++ 0046-eal-fix-memory-leak-when-saving-arguments.patch	2021-11-10 14:17:01.797413358 +0800
@@ -1 +1 @@
-From 4777674c4428f528fa2890d8afab551f6dd54c24 Mon Sep 17 00:00:00 2001
+From fcece17c517b90e30826955e4a6f6f54df2c0e90 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 4777674c4428f528fa2890d8afab551f6dd54c24 ]
@@ -18 +21 @@
- lib/eal/common/eal_common_options.c | 2 +-
+ lib/librte_eal/common/eal_common_options.c | 2 +-
@@ -21,5 +24,5 @@
-diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
-index 6ecf5fd660..eaef57312f 100644
---- a/lib/eal/common/eal_common_options.c
-+++ b/lib/eal/common/eal_common_options.c
-@@ -223,9 +223,9 @@ eal_save_args(int argc, char **argv)
+diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
+index f8ab47435d..977ba21c51 100644
+--- a/lib/librte_eal/common/eal_common_options.c
++++ b/lib/librte_eal/common/eal_common_options.c
+@@ -228,9 +228,9 @@ eal_save_args(int argc, char **argv)


More information about the stable mailing list