From: Anatoly Burakov Date: Mon, 16 Apr 2018 14:40:02 +0000 (+0100) Subject: mem: fix resource leak on map failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5441fcfd874d8d1ac86e38858f61310c63180204;p=dpdk.git mem: fix resource leak on map failure Coverity issue: 272601 Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists") Signed-off-by: Anatoly Burakov Acked-by: Bruce Richardson --- diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index fadc1dec9e..9351e841c5 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -1750,6 +1750,7 @@ eal_legacy_hugepage_attach(void) if (map_addr == MAP_FAILED) { RTE_LOG(ERR, EAL, "Could not map %s: %s\n", hf->filepath, strerror(errno)); + close(fd); goto error; }