mem: fix leak after mapping failure
authorMarcin Kerlin <marcinx.kerlin@intel.com>
Thu, 16 Jun 2016 15:14:00 +0000 (17:14 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 20 Jun 2016 09:26:41 +0000 (11:26 +0200)
commitea329d7f8e34645dc82068f195dadddb477d4efb
tree4ebeb078eb094bd02cdef63825a0c12404400484
parent2489f1193c1617d55af57d8184a0e9e9ace1c848
mem: fix leak after mapping failure

Patch fixes resource leak in rte_eal_hugepage_attach() where mapped files
were not freed back to the OS in case of failure. Patch uses the behavior
of Linux munmap: "It is not an error if the indicated range does not
contain any mapped pages".

Coverity issue: 13295, 13296, 13303

Fixes: af75078fece3 ("first public release")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
lib/librte_eal/linuxapp/eal/eal_memory.c