summaryrefslogtreecommitdiffstats
path: root/src/vlib/main.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-11-07 20:46:38 -0800
committerDamjan Marion <dmarion@me.com>2018-11-08 11:20:06 +0000
commit221d6f131d644b2d14f741c4b3031f53b8a8ff03 (patch)
tree6d0a76a25a3d0f82443f0586c9e87c20b89abe6a /src/vlib/main.c
parentb2bc03b3d055e601a5667c61a28f78520dd84d50 (diff)
vlib: use index to free suspended frame
Avoids crash if suspended_process_frames grows. Change-Id: Id26ef0dd0dd001b997c531c4dec004e7e7989670 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vlib/main.c')
-rw-r--r--src/vlib/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c
index df7c2f1e007..1b9eb39bf95 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -1416,9 +1416,8 @@ dispatch_suspended_process (vlib_main_t * vm,
ASSERT (p->flags & (VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_CLOCK
| VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_EVENT));
- pf =
- pool_elt_at_index (nm->suspended_process_frames,
- p->suspended_process_frame_index);
+ pf = pool_elt_at_index (nm->suspended_process_frames,
+ p->suspended_process_frame_index);
node_runtime = &p->node_runtime;
node = vlib_get_node (vm, node_runtime->node_index);
@@ -1454,8 +1453,9 @@ dispatch_suspended_process (vlib_main_t * vm,
else
{
p->flags &= ~VLIB_PROCESS_IS_RUNNING;
+ pool_put_index (nm->suspended_process_frames,
+ p->suspended_process_frame_index);
p->suspended_process_frame_index = ~0;
- pool_put (nm->suspended_process_frames, pf);
}
t = clib_cpu_time_now ();