summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/linux
diff options
context:
space:
mode:
authorChris Luke <chrisy@flirble.org>2017-09-26 13:15:16 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-09-27 17:08:08 +0000
commit879ace3d3b238ec8db80f52ebfd556aa6f12b4c7 (patch)
tree1222ac207c4ffdad33ee52de5e151a053c78ac5c /src/vppinfra/linux
parent987abe9eeb65a3950401073c770012a7898593b7 (diff)
Various fixes for issues found by Coverity (VPP-972)
174267: Revisit this string termination issue 174816: Add check for NULL when trace is enabled 177211: Add notation that mutex is not required here 177117: Added check for log2_page_size == 0 and returns an error if so 163697,163698: Added missing sw_if_index validation Change-Id: I5a76fcf6505c785bfb3269e353360031c6a0fd0f Signed-off-by: Chris Luke <chrisy@flirble.org>
Diffstat (limited to 'src/vppinfra/linux')
-rw-r--r--src/vppinfra/linux/mem.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vppinfra/linux/mem.c b/src/vppinfra/linux/mem.c
index df46763ab2c..2d8f593d2b6 100644
--- a/src/vppinfra/linux/mem.c
+++ b/src/vppinfra/linux/mem.c
@@ -132,6 +132,12 @@ clib_mem_vm_ext_alloc (clib_mem_vm_alloc_t * a)
}
}
log2_page_size = clib_mem_vm_get_log2_page_size (fd);
+
+ if (log2_page_size == 0)
+ {
+ err = clib_error_return_unix (0, "cannot determine page size");
+ goto error;
+ }
}
else /* not CLIB_MEM_VM_F_SHARED */
{