Skip to contentSkip to conversation

spl: Improve error message for SPL memory allocation

PATCH In review Leo Yu-Chi Liang 2 participants 2 messages Mar 13, 2024 – Mar 21, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl: Improve error message for SPL memory allocation

There could be two memory allocation scheme in SPL phase. Explicitly print the corresponding error message.

---
 common/spl/spl_fit.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
common/spl/spl_fit.c +6 -1
index 872df0c0fe..e5195d460c 100644
@@ -550,7 +550,12 @@ static void *spl_get_fit_load_buffer(size_t size)
 	buf = malloc_cache_aligned(size);
 	if (!buf) {
 		pr_err("Could not get FIT buffer of %lu bytes\n", (ulong)size);
-		pr_err("\tcheck CONFIG_SPL_SYS_MALLOC_SIZE\n");
+
+		if (IS_ENABLED(CONFIG_SPL_SYS_MALLOC))
+			pr_err("\tcheck CONFIG_SPL_SYS_MALLOC_SIZE\n");
+		else
+			pr_err("\tcheck CONFIG_SPL_SYS_MALLOC_F_LEN\n");
+
 		buf = spl_get_load_buffer(0, size);
 	}
 	return buf;
Signature · 1 line
2.34.1
#1 lore raw
Quoted 4 lines · Leo Yu-Chi Liang

There could be two memory allocation scheme in SPL phase. Explicitly print the corresponding error message.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom