From 438b11bab2552e2c40de027be033c6cdef679639 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter Date: Mon, 12 Feb 2024 11:31:58 +0100 Subject: [PATCH] lib: alloc: k_panic is not required in failure case 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: https://github.com/thesofproject/sof/issues/8832, but it is sufficient to log error and return NULL at this point. Signed-off-by: Jaroslaw Stelter --- zephyr/lib/alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zephyr/lib/alloc.c b/zephyr/lib/alloc.c index 50508a68d..7a395397f 100644 --- a/zephyr/lib/alloc.c +++ b/zephyr/lib/alloc.c @@ -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;