session: cleanup part 1
[vpp.git] / src / vnet / session / segment_manager.c
index e48e951..a4438c7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Copyright (c) 2017-2019 Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
@@ -379,7 +379,7 @@ void
 segment_manager_del_sessions (segment_manager_t * sm)
 {
   svm_fifo_segment_private_t *fifo_segment;
-  stream_session_t *session;
+  session_t *session;
   svm_fifo_t *fifo;
 
   ASSERT (pool_elts (sm->segments) != 0);
@@ -599,6 +599,9 @@ segment_manager_dealloc_fifos (u32 segment_index, svm_fifo_t * rx_fifo,
   svm_fifo_segment_private_t *fifo_segment;
   segment_manager_t *sm;
 
+  if (!rx_fifo || !tx_fifo)
+    return;
+
   /* It's possible to have no segment manager if the session was removed
    * as result of a detach. */
   if (!(sm = segment_manager_get_if_valid (rx_fifo->segment_manager)))