[PATCH 7/9] console: Make sure xzalloc is only used when it's available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To make it possible to call the pr_* functions very early before
malloc is initialized test if malloc is available before using
it.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 common/console_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/console_common.c b/common/console_common.c
index cc25f97..df1b085 100644
--- a/common/console_common.c
+++ b/common/console_common.c
@@ -101,7 +101,7 @@ void pr_puts(int level, const char *str)
 {
 	struct log_entry *log;
 
-	if (IS_ENABLED(CONFIG_LOGBUF)) {
+	if (IS_ENABLED(CONFIG_LOGBUF) && mem_malloc_is_initialized()) {
 		if (barebox_log_max_messages > 0)
 			log_clean(barebox_log_max_messages - 1);
 
-- 
2.1.3


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux