[dpdk-stable] patch 'sched: fix profile allocation failure handling' has been queued to stable release 20.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 26 15:53:19 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.3

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/41a170fc81d6ca4ca9eb7ff6364fe5c4eaf95225

Thanks.

Luca Boccassi

---
>From 41a170fc81d6ca4ca9eb7ff6364fe5c4eaf95225 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong at huawei.com>
Date: Fri, 23 Apr 2021 19:01:11 +0800
Subject: [PATCH] sched: fix profile allocation failure handling

[ upstream commit a042481ecd9e890b7fc088f9d2a3a6b6e82d3a4c ]

This patch fixes return value judgment when allocate memory to store the
subport profile, and releases memory of 'rte_sched_port' if code fails to
apply for this memory.

Fixes: 0ea4c6afcaf1 ("sched: add subport profile table")

Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
---
 lib/librte_sched/rte_sched.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index cd87e688e4..df0ab5cab9 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -961,9 +961,9 @@ rte_sched_port_config(struct rte_sched_port_params *params)
 	/* Allocate memory to store the subport profile */
 	port->subport_profiles  = rte_zmalloc_socket("subport_profile", size2,
 					RTE_CACHE_LINE_SIZE, params->socket);
-	if (port == NULL) {
+	if (port->subport_profiles == NULL) {
 		RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", __func__);
-
+		rte_free(port);
 		return NULL;
 	}
 
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-07-26 13:53:19.205641754 +0100
+++ 0056-sched-fix-profile-allocation-failure-handling.patch	2021-07-26 13:53:15.969295145 +0100
@@ -1 +1 @@
-From a042481ecd9e890b7fc088f9d2a3a6b6e82d3a4c Mon Sep 17 00:00:00 2001
+From 41a170fc81d6ca4ca9eb7ff6364fe5c4eaf95225 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a042481ecd9e890b7fc088f9d2a3a6b6e82d3a4c ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -17 +18 @@
- lib/sched/rte_sched.c | 4 ++--
+ lib/librte_sched/rte_sched.c | 4 ++--
@@ -20 +21 @@
-diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c
+diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
@@ -22,2 +23,2 @@
---- a/lib/sched/rte_sched.c
-+++ b/lib/sched/rte_sched.c
+--- a/lib/librte_sched/rte_sched.c
++++ b/lib/librte_sched/rte_sched.c


More information about the stable mailing list