Skip to content

Commit

Permalink
lib: alloc: k_panic is not required in failure case
Browse files Browse the repository at this point in the history
For rballoc_allign() call when caps are not correct it is
enough to return error. k_panic() call is not required here.
Previous change exposed this issue:
#8832,
but it is sufficient to log error and return NULL at this point.

Signed-off-by: Jaroslaw Stelter <[email protected]>
  • Loading branch information
jxstelter authored and lgirdwood committed Feb 14, 2024
1 parent af80acc commit 438b11b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zephyr/lib/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ void *rballoc_align(uint32_t flags, uint32_t caps, size_t bytes,
heap = &l3_heap;
return (__sparse_force void *)l3_heap_alloc_aligned(heap, align, bytes);
#else
k_panic();
tr_err(&zephyr_tr, "L3_HEAP not available.");
return NULL;
#endif
} else {
heap = &sof_heap;
Expand Down

0 comments on commit 438b11b

Please sign in to comment.