patch 'mem: check allocation in dynamic hugepage init' has been queued to stable release 21.11.1

Kevin Traynor ktraynor at redhat.com
Mon Feb 21 16:35:43 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.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/26/22. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/1058b2c36938b2b6f865d810cd8f9ef3d3011fbb

Thanks.

Kevin

---
>From 1058b2c36938b2b6f865d810cd8f9ef3d3011fbb Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Tue, 14 Dec 2021 21:30:25 +0800
Subject: [PATCH] mem: check allocation in dynamic hugepage init

[ upstream commit 5f69ebbd85300a197bbe9e6a630642352f5aba39 ]

The function malloc() could return NULL, the return value
need to be checked.

Fixes: 6f63858e55e6 ("mem: prevent preallocated pages from being freed")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
 lib/eal/common/eal_common_dynmem.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/eal/common/eal_common_dynmem.c b/lib/eal/common/eal_common_dynmem.c
index 7c5437ddfa..c1e1889f5c 100644
--- a/lib/eal/common/eal_common_dynmem.c
+++ b/lib/eal/common/eal_common_dynmem.c
@@ -305,4 +305,8 @@ eal_dynmem_hugepage_init(void)
 
 				pages = malloc(sizeof(*pages) * needed);
+				if (pages == NULL) {
+					RTE_LOG(ERR, EAL, "Failed to malloc pages\n");
+					return -1;
+				}
 
 				/* do not request exact number of pages */
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-21 15:22:47.904276193 +0000
+++ 0154-mem-check-allocation-in-dynamic-hugepage-init.patch	2022-02-21 15:22:44.304704606 +0000
@@ -1 +1 @@
-From 5f69ebbd85300a197bbe9e6a630642352f5aba39 Mon Sep 17 00:00:00 2001
+From 1058b2c36938b2b6f865d810cd8f9ef3d3011fbb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5f69ebbd85300a197bbe9e6a630642352f5aba39 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list