From 0125cabec7d7d2eac5f79ccbfc319753230eb521 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Tue, 8 Oct 2019 21:03:45 -0400 Subject: [PATCH] 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 --- tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c b/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c index 06ff46f8488daf..04798a81f95350 100644 --- a/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c +++ b/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c @@ -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); } }