[dpdk-stable] patch 'mem: fix mmap error check on huge page attach' has been queued to LTS release 16.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Jan 26 14:12:34 CET 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 01/28/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From 6f8b9f0a1b53743ca27af98d4a4a78a244389175 Mon Sep 17 00:00:00 2001
From: Michael McConville <mmcco at mykolab.com>
Date: Thu, 30 Nov 2017 23:51:13 -0700
Subject: [PATCH] mem: fix mmap error check on huge page attach

[ upstream commit b45056be0429d6df2313e5e49aa8f78e5d840a97 ]

mmap(2) returns MAP_FAILED, not NULL, on failure.

Signed-off-by: Michael McConville <mmcco at mykolab.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 lib/librte_eal/bsdapp/eal/eal_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 3614da8db..248312d96 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -150,7 +150,7 @@ rte_eal_hugepage_attach(void)
 	/* Map the shared hugepage_info into the process address spaces */
 	hpi = mmap(NULL, sizeof(struct hugepage_info), PROT_READ, MAP_PRIVATE,
 			fd_hugepage_info, 0);
-	if (hpi == NULL) {
+	if (hpi == MAP_FAILED) {
 		RTE_LOG(ERR, EAL, "Could not mmap %s\n", eal_hugepage_info_path());
 		goto error;
 	}
-- 
2.14.2



More information about the stable mailing list