]> git.droids-corp.org - dpdk.git/commitdiff
mem: fix resource leak on map failure
authorAnatoly Burakov <anatoly.burakov@intel.com>
Mon, 16 Apr 2018 14:40:02 +0000 (15:40 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 27 Apr 2018 21:42:40 +0000 (23:42 +0200)
Coverity issue: 272601
Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_eal/linuxapp/eal/eal_memory.c

index fadc1dec9e6914bf40177fd87d13460b5dfd073c..9351e841c5c2b8d1dc3483a544073424e308b9b2 100644 (file)
@@ -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;
                }