summaryrefslogtreecommitdiffstats
path: root/drivers/serial/amba-pl011.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-12-22 23:11:06 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2011-12-23 11:15:44 +0100
commit4b8750c95610f601ac7e8571713eab268877d224 (patch)
tree1dfd108d86add8d1d0fd34e01d4b431acbdc7da2 /drivers/serial/amba-pl011.c
parentf02a48ea00637025dc13d86d1ff024b6aec071d7 (diff)
downloadbarebox-4b8750c95610f601ac7e8571713eab268877d224.tar.gz
barebox-4b8750c95610f601ac7e8571713eab268877d224.tar.xz
uart drivers: use xzalloc instead of xmalloc
The flags in struct console_device have to be initialized to zero. Otherwise the following can happen: - console_register sets the initial baudrate of a new console before we set the global console init state to CONSOLE_INIT_FULL. - In console_baudrate_set we test whether the current console is active which may be true because of unitialized flags. - we then call getc() to wait for the user to accept the new settings and we are stuck because of the CONSOLE_UNINITIALIZED state we will never get anything from getc(). Looking back this explains some cases for me when barebox refused to start and I really wonder why this did not become a more visible problem before. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial/amba-pl011.c')
-rw-r--r--drivers/serial/amba-pl011.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 148bdbf576..56f6f15825 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -159,7 +159,7 @@ static int pl011_probe(struct device_d *dev)
struct amba_uart_port *uart;
struct console_device *cdev;
- uart = xmalloc(sizeof(struct amba_uart_port));
+ uart = xzalloc(sizeof(struct amba_uart_port));
uart->clk = clk_get(dev, NULL);
if (IS_ERR(uart->clk))