hsa: use common app session interface in echo tests
[vpp.git] / src / svm / fifo_segment.c
index 77177a1..d5f6291 100644 (file)
@@ -312,7 +312,7 @@ fifo_segment_init (fifo_segment_t * fs)
 
   seg_start = round_pow2_u64 (pointer_to_uword (seg_data), align);
   fsh = uword_to_pointer (seg_start, void *);
-  CLIB_MEM_UNPOISON (fsh, seg_sz);
+  clib_mem_unpoison (fsh, seg_sz);
   memset (fsh, 0, sizeof (*fsh) + slices_sz);
 
   fsh->byte_index = sizeof (*fsh) + slices_sz;
@@ -781,7 +781,7 @@ fsh_slice_collect_chunks (fifo_segment_header_t * fsh,
 
   while (c)
     {
-      CLIB_MEM_UNPOISON (c, sizeof (*c));
+      clib_mem_unpoison (c, sizeof (*c));
       next = fs_chunk_ptr (fsh, c->next);
       fl_index = fs_freelist_for_size (c->length);
       fss_chunk_free_list_push (fsh, fss, fl_index, c);
@@ -836,7 +836,7 @@ fifo_segment_cleanup (fifo_segment_t *fs)
 
   vec_free (fs->slices);
 
-  vec_foreach (fs->mqs, mq)
+  vec_foreach (mq, fs->mqs)
     svm_msg_q_cleanup (mq);
 
   vec_free (fs->mqs);
@@ -1098,6 +1098,9 @@ fifo_segment_msg_q_alloc (fifo_segment_t *fs, u32 mq_index,
 
   size = svm_msg_q_size_to_alloc (cfg);
   base = fsh_alloc_aligned (fsh, size, 8);
+  if (!base)
+    return 0;
+
   fsh->n_reserved_bytes += size;
 
   smq = svm_msg_q_init (base, cfg);