aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2019-11-18 10:23:54 +0000
committerDave Barach <openvpp@barachs.net>2019-11-22 17:38:15 +0000
commit9ce35233658d6c19a4458ec7e728b6ee75fd3ace (patch)
tree77ff2e9d3cd4af5ca7f07a00e0fd37062e6f340f /src/vppinfra
parent418ebb711e7f32a160f824cee7de0122076d216a (diff)
vppinfra: fix coverity issue 205691 in pmalloc
set the address to MMAP_FAILED if mmap has failed, so that we do not attempt to free it in the error handling path. Change-Id: I6e6b51a365fb68086dc20aa40a676a36af59a3ba Type: fix Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/pmalloc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vppinfra/pmalloc.c b/src/vppinfra/pmalloc.c
index ce78ca00334..cca8039433d 100644
--- a/src/vppinfra/pmalloc.c
+++ b/src/vppinfra/pmalloc.c
@@ -331,6 +331,7 @@ pmalloc_map_pages (clib_pmalloc_main_t * pm, clib_pmalloc_arena_t * a,
pm->error = clib_error_return_unix (0, "failed to mmap %u pages at %p "
"fd %d numa %d flags 0x%x", n_pages,
va, a->fd, numa_node, mmap_flags);
+ va = MAP_FAILED;
goto error;
}