aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanh-arm <dan.handley@arm.com>2014-06-23 12:43:58 +0100
committerdanh-arm <dan.handley@arm.com>2014-06-23 12:43:58 +0100
commitc2c5ee2d8383448a0f7fbdbb7410907461b399b8 (patch)
treea35d60f77751536f4c3423db6c81975565f24ac3
parente869310f67344cd1f2b531cff38fa8cb4d319d58 (diff)
parent0695dc49e2f1fcaef673ad7a50d9ec97ae3744b5 (diff)
downloadarm-trusted-firmware-c2c5ee2d8383448a0f7fbdbb7410907461b399b8.tar.gz
Merge pull request #142 from athoelke/at/fix-console_putc
Remove broken assertion in console_putc()
-rw-r--r--drivers/arm/pl011/pl011_console.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/arm/pl011/pl011_console.c b/drivers/arm/pl011/pl011_console.c
index a26c00e..81897ca 100644
--- a/drivers/arm/pl011/pl011_console.c
+++ b/drivers/arm/pl011/pl011_console.c
@@ -71,7 +71,12 @@ void console_init(unsigned long base_addr)
int console_putc(int c)
{
- assert(uart_base);
+ /* If the console has not been initialized then return an error
+ * code. Asserting here would result in recursion and stack
+ * exhaustion
+ */
+ if (!uart_base)
+ return -1;
if (c == '\n') {
WAIT_UNTIL_UART_FREE(uart_base);