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>
diff --git a/src/vppinfra/linux/mem.c b/src/vppinfra/linux/mem.c
index df46763..2d8f593 100644
--- a/src/vppinfra/linux/mem.c
+++ b/src/vppinfra/linux/mem.c
@@ -132,6 +132,12 @@
}
}
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 */
{