[RFC,4/5] eal/memory: avoid double munmap in error path
Checks
Commit Message
Don't call munmap of hugepage memory twice in the error path.
Coverity issue: 325730
Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 1 +
1 file changed, 1 insertion(+)
Comments
06/11/2018 22:49, Stephen Hemminger:
> Don't call munmap of hugepage memory twice in the error path.
>
> Coverity issue: 325730
> Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Thank you
Anatoly submitted the same fix:
https://patches.dpdk.org/patch/47898/
@@ -1617,6 +1617,7 @@ eal_legacy_hugepage_init(void)
tmp_hp = NULL;
munmap(hugepage, nr_hugefiles * sizeof(struct hugepage_file));
+ hugepage = NULL;
/* we're not going to allocate more pages, so release VA space for
* unused memseg lists