Skip to content

Commit

Permalink
zephyr: lib: alloc: k_panic is not required in failure scenario
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: thesofproject#8832,
but it is sufficient to log error and return NULL at this point.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
  • Loading branch information
jxstelter committed Feb 12, 2024
1 parent 557e581 commit 5f267da
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 5f267da

Please sign in to comment.