summaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_private.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-04-07 00:16:37 -0700
committerFlorin Coras <florin.coras@gmail.com>2021-04-07 14:21:05 +0000
commit70e21976aa0303c037ef849f7859010c9d543fab (patch)
treebd64b28071d702277057875d5db4298010083160 /src/vcl/vcl_private.c
parent1c19aefe907d2a7251ed538241256b4359e96167 (diff)
vcl: fix worker cleanup cb function
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic1d88c01e48bb926932030c3c5a03f35e345e9eb
Diffstat (limited to 'src/vcl/vcl_private.c')
-rw-r--r--src/vcl/vcl_private.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vcl/vcl_private.c b/src/vcl/vcl_private.c
index d6d7381e40b..eb01d1c14b1 100644
--- a/src/vcl/vcl_private.c
+++ b/src/vcl/vcl_private.c
@@ -138,8 +138,14 @@ vcl_worker_cleanup (vcl_worker_t * wrk, u8 notify_vpp)
static void
vcl_worker_cleanup_cb (void *arg)
{
- vcl_worker_t *wrk = vcl_worker_get_current ();
- u32 wrk_index = wrk->wrk_index;
+ vcl_worker_t *wrk;
+ u32 wrk_index;
+
+ wrk_index = vcl_get_worker_index ();
+ wrk = vcl_worker_get_if_valid (wrk_index);
+ if (!wrk)
+ return;
+
vcl_worker_cleanup (wrk, 1 /* notify vpp */ );
vcl_set_worker_index (~0);
VDBG (0, "cleaned up worker %u", wrk_index);