[dpdk-stable] patch 'app/testpmd: fix memory failure handling for i40e DDP' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:05:32 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.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 05/21/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 f83c2ba6ea55b08113640b0b6da079b516095861 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Fri, 8 May 2020 10:20:24 +0530
Subject: [PATCH] app/testpmd: fix memory failure handling for i40e DDP

[ upstream commit 489bdbbfc269c819ec679605d1f0e8ad058789f4 ]

In cmd_ddp_get_list_parsed(), elements of "p_list" are accessed
even after the memory allocation for "p_list" fails.

With this patch, this null pointer dereference is avoided as we
return when there is malloc failure.

Fixes: e088907bb851 ("app/testpmd: add command for getting loaded DDP profiles")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Acked-by: Bernard Iremonger <bernard.iremonger at intel.com>
---
 app/test-pmd/cmdline.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 1dbde50566..d508d1e26d 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -16805,8 +16805,10 @@ cmd_ddp_get_list_parsed(
 #ifdef RTE_LIBRTE_I40E_PMD
 	size = PROFILE_INFO_SIZE * MAX_PROFILE_NUM + 4;
 	p_list = (struct rte_pmd_i40e_profile_list *)malloc(size);
-	if (!p_list)
+	if (!p_list) {
 		printf("%s: Failed to malloc buffer\n", __func__);
+		return;
+	}
 
 	if (ret == -ENOTSUP)
 		ret = rte_pmd_i40e_get_ddp_list(res->port_id,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:52.622826347 +0100
+++ 0197-app-testpmd-fix-memory-failure-handling-for-i40e-DDP.patch	2020-05-19 14:04:44.572654826 +0100
@@ -1,8 +1,10 @@
-From 489bdbbfc269c819ec679605d1f0e8ad058789f4 Mon Sep 17 00:00:00 2001
+From f83c2ba6ea55b08113640b0b6da079b516095861 Mon Sep 17 00:00:00 2001
 From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
 Date: Fri, 8 May 2020 10:20:24 +0530
 Subject: [PATCH] app/testpmd: fix memory failure handling for i40e DDP
 
+[ upstream commit 489bdbbfc269c819ec679605d1f0e8ad058789f4 ]
+
 In cmd_ddp_get_list_parsed(), elements of "p_list" are accessed
 even after the memory allocation for "p_list" fails.
 
@@ -10,7 +12,6 @@
 return when there is malloc failure.
 
 Fixes: e088907bb851 ("app/testpmd: add command for getting loaded DDP profiles")
-Cc: stable at dpdk.org
 
 Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
 Acked-by: Bernard Iremonger <bernard.iremonger at intel.com>
@@ -19,10 +20,10 @@
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
-index b040630c54..996a498768 100644
+index 1dbde50566..d508d1e26d 100644
 --- a/app/test-pmd/cmdline.c
 +++ b/app/test-pmd/cmdline.c
-@@ -16891,8 +16891,10 @@ cmd_ddp_get_list_parsed(
+@@ -16805,8 +16805,10 @@ cmd_ddp_get_list_parsed(
  #ifdef RTE_LIBRTE_I40E_PMD
  	size = PROFILE_INFO_SIZE * MAX_PROFILE_NUM + 4;
  	p_list = (struct rte_pmd_i40e_profile_list *)malloc(size);


More information about the stable mailing list