aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-04-14 17:55:02 -0700
committerDave Barach <openvpp@barachs.net>2021-04-15 16:38:02 +0000
commitcf0e257dcf3d23a3b38129e1a3375f1c38c10973 (patch)
tree2db056a40efb864b136de00e54f7452e966387c0 /src/vcl
parent0e79bc14babb282f8ba0dca2237209da80be6317 (diff)
vcl: validate fs before cleanup
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1d3677923ab28325380c4a9e8469da83077262a9
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/vcl_private.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vcl/vcl_private.c b/src/vcl/vcl_private.c
index eb01d1c14b1..ba54c91f5cd 100644
--- a/src/vcl/vcl_private.c
+++ b/src/vcl/vcl_private.c
@@ -459,8 +459,11 @@ vcl_session_detach_fifos (vcl_session_t *s)
fifo_segment_free_client_fifo (fs, s->tx_fifo);
if (s->ct_rx_fifo)
{
- fs = fifo_segment_get_segment (&vcm->segment_main,
- s->ct_rx_fifo->segment_index);
+ fs = fifo_segment_get_segment_if_valid (&vcm->segment_main,
+ s->ct_rx_fifo->segment_index);
+ if (!fs)
+ goto done;
+
fifo_segment_free_client_fifo (fs, s->ct_rx_fifo);
fifo_segment_free_client_fifo (fs, s->ct_tx_fifo);
}