From 0a0e711cce0f29012ceb6bcde732c072415c2f96 Mon Sep 17 00:00:00 2001 From: Ray Kinsella Date: Fri, 28 Jan 2022 04:59:00 +0000 Subject: perfmon: check for duplicates after other checks Move checking for duplicate bundle names after the other checks. Type: fix Signed-off-by: Ray Kinsella Change-Id: I7fed5be758814e166eb8756b3df090130ac13bfd --- src/plugins/perfmon/perfmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/perfmon/perfmon.c') diff --git a/src/plugins/perfmon/perfmon.c b/src/plugins/perfmon/perfmon.c index 15690361a7f..594a98759c8 100644 --- a/src/plugins/perfmon/perfmon.c +++ b/src/plugins/perfmon/perfmon.c @@ -398,9 +398,6 @@ perfmon_init (vlib_main_t *vm) clib_error_t *err; uword *p; - if (hash_get_mem (pm->bundle_by_name, b->name) != 0) - clib_panic ("duplicate bundle name '%s'", b->name); - if ((p = hash_get_mem (pm->source_by_name, b->source)) == 0) { log_debug ("missing source '%s', skipping bundle '%s'", b->source, @@ -426,6 +423,9 @@ perfmon_init (vlib_main_t *vm) continue; } + if (hash_get_mem (pm->bundle_by_name, b->name) != 0) + clib_panic ("duplicate bundle name '%s'", b->name); + hash_set_mem (pm->bundle_by_name, b->name, b); log_debug ("bundle '%s' regisrtered", b->name); -- cgit 1.2.3-korg