Skip to content

Commit

Permalink
test_pipe_contexts: don't free memory blocks handed to k_pipe_block_put
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Nicolas Pitre authored and andrewboie committed Oct 9, 2019
1 parent b71eb71 commit 0125cab
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 0125cab

Please sign in to comment.