aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVengada Govindan <venggovi@cisco.com>2016-09-07 22:19:36 -0700
committerVengada Govindan <venggovi@cisco.com>2016-09-07 22:19:36 -0700
commit7a35ee91a40e512b353f8f41f7a2d5fe32a29eca (patch)
treef37c058bfcb796578f857a68898ee8df6d08a0f3
parent3b480933c80cac8963995b61f48ee9aedb3d6e16 (diff)
Fix Coverity issue in trace_util.c (REVERSE_INULL), thanks to Damjan for highlighting this.
Change-Id: I22b1dc800624042e043e7632179f6281a6ccaafc Signed-off-by: Vengada Govindan <venggovi@cisco.com>
-rw-r--r--plugins/ioam-plugin/ioam/lib-trace/trace_util.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/ioam-plugin/ioam/lib-trace/trace_util.c b/plugins/ioam-plugin/ioam/lib-trace/trace_util.c
index 4bc9f84deec..9694a751a4f 100644
--- a/plugins/ioam-plugin/ioam/lib-trace/trace_util.c
+++ b/plugins/ioam-plugin/ioam/lib-trace/trace_util.c
@@ -173,8 +173,13 @@ show_trace_profile_command_fn (vlib_main_t * vm,
trace_profile *p = NULL;
u8 *s = 0;
p = trace_profile_find ();
- if (p->valid == 0)
- return 0;
+ if (!(p && p->valid))
+ {
+ s = format (s, "\nTrace configuration not valid\n");
+ vlib_cli_output (vm, "%v", s);
+ vec_free (s);
+ return 0;
+ }
s = format (s, " HOP BY HOP OPTIONS - TRACE CONFIG - \n");
s = format (s, " Trace Type : 0x%x (%d)\n",
p->trace_type, p->trace_type);
@@ -196,10 +201,6 @@ show_trace_profile_command_fn (vlib_main_t * vm,
s =
format (s, " App Data : 0x%x (%d)\n",
p->app_data, p->app_data);
- if (!(p && p->valid))
- {
- s = format (s, "\nTrace configuration not valid\n");
- }
vlib_cli_output (vm, "%v", s);
vec_free (s);
return 0;