test_pipe_contexts: don't free memory blocks handed to k_pipe_block_put

Documentation for k_pipe_block_put() says:

  This routine writes the data contained in a memory block to pipe.
  Once all of the data in the block has been written to the pipe,
  it will free the memory block.

Therefore it is wrong to free the memory block within the test code.
When the mempool allocator is instrumented to detect double-free
instances, this case is signaled right away.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
Nicolas Pitre 2019-10-08 21:03:45 -04:00 committed by Andrew Boie
commit 0125cabec7

View file

@ -62,7 +62,6 @@ static void tpipe_block_put(struct k_pipe *ppipe, struct k_sem *sema,
if (sema) {
k_sem_take(sema, K_FOREVER);
}
k_mem_pool_free(&block);
}
}