git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4a386cf
)
mem: fix mmap error check on huge page attach
author
Michael McConville
<mmcco@mykolab.com>
Fri, 1 Dec 2017 06:51:13 +0000
(23:51 -0700)
committer
Thomas Monjalon
<thomas@monjalon.net>
Tue, 9 Jan 2018 15:59:50 +0000
(16:59 +0100)
mmap(2) returns MAP_FAILED, not NULL, on failure.
Signed-off-by: Michael McConville <mmcco@mykolab.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_eal/bsdapp/eal/eal_memory.c
patch
|
blob
|
history
diff --git
a/lib/librte_eal/bsdapp/eal/eal_memory.c
b/lib/librte_eal/bsdapp/eal/eal_memory.c
index
45b198f
..
bdfb882
100644
(file)
--- a/
lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/
lib/librte_eal/bsdapp/eal/eal_memory.c
@@
-126,7
+126,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;
}