summaryrefslogtreecommitdiffstats
path: root/src/svm/message_queue.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-03-30 00:23:54 -0700
committerDamjan Marion <dmarion@me.com>2021-03-30 13:17:42 +0000
commit8c517c8fb44e7003ecdb615bc03163536e24d4d4 (patch)
treef073b3ea507a71b30d97cf42a6c10ee7c4af51af /src/svm/message_queue.c
parentf632ab5e3ba1882106975814597a8e39507d8873 (diff)
svm: cleanup mq private data on fifo segment cleanup
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I65373f2cd5a33381da1e51ed7ab7a8b1358cef29
Diffstat (limited to 'src/svm/message_queue.c')
-rw-r--r--src/svm/message_queue.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/svm/message_queue.c b/src/svm/message_queue.c
index e08ba06fb27..a6af7962f73 100644
--- a/src/svm/message_queue.c
+++ b/src/svm/message_queue.c
@@ -167,10 +167,19 @@ svm_msg_q_attach (svm_msg_q_t *mq, void *smq_base)
}
void
+svm_msg_q_cleanup (svm_msg_q_t *mq)
+{
+ vec_free (mq->rings);
+ clib_spinlock_free (&mq->q.lock);
+ if (mq->q.evtfd != -1)
+ close (mq->q.evtfd);
+}
+
+void
svm_msg_q_free (svm_msg_q_t * mq)
{
+ svm_msg_q_cleanup (mq);
clib_mem_free (mq->q.shr);
- clib_spinlock_free (&mq->q.lock);
clib_mem_free (mq);
}