Skip to content
Browse files

kernel: fix k_stack_alloc_init()

k_stack_alloc_init() was creating a buffer that was 4 times
too small to support the requested number of entries, since
each entry in a k_stack is a u32_t.

Fixes: #15911

Signed-off-by: Andrew Boie <>
  • Loading branch information...
andrewboie authored and nashif committed May 6, 2019
1 parent 15baad9 commit be3d4232c223b830321673586520db5b0c5be0ed
Showing with 1 addition and 1 deletion.
  1. +1 −1 kernel/stack.c
@@ -63,7 +63,7 @@ s32_t z_impl_k_stack_alloc_init(struct k_stack *stack, u32_t num_entries)
void *buffer;
s32_t ret;

buffer = z_thread_malloc(num_entries);
buffer = z_thread_malloc(num_entries * sizeof(u32_t));
if (buffer != NULL) {
k_stack_init(stack, buffer, num_entries);
stack->flags = K_STACK_FLAG_ALLOC;

0 comments on commit be3d423

Please sign in to comment.
You can’t perform that action at this time.