aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/policer/policer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/policer/policer.c')
-rw-r--r--src/vnet/policer/policer.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/vnet/policer/policer.c b/src/vnet/policer/policer.c
index 290a6af57e2..cd754e29be9 100644
--- a/src/vnet/policer/policer.c
+++ b/src/vnet/policer/policer.c
@@ -413,6 +413,7 @@ configure_policer_command_fn (vlib_main_t * vm,
u8 is_add = 1;
u8 *name = 0;
u32 pi;
+ clib_error_t *error = NULL;
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
@@ -433,13 +434,19 @@ configure_policer_command_fn (vlib_main_t * vm,
foreach_config_param
#undef _
else
- return clib_error_return (0, "unknown input `%U'",
- format_unformat_error, line_input);
+ {
+ error = clib_error_return (0, "unknown input `%U'",
+ format_unformat_error, line_input);
+ goto done;
+ }
}
+ error = policer_add_del (vm, name, &c, &pi, is_add);
+
+done:
unformat_free (line_input);
- return policer_add_del (vm, name, &c, &pi, is_add);
+ return error;
}
/* *INDENT-OFF* */