From 70d89b97afcbb911c21a0fb6ac2c8130dd87e9ae Mon Sep 17 00:00:00 2001 From: Kalle Vahlman Date: Thu, 16 Feb 2012 21:31:40 +0200 Subject: serial/amba-pl011: Return early in deadlock work-around if there is no tty The first amba port does not always have an attached tty, which will result in a crash if the work-around is activated. This seems to be the case for example on Snowball which has no modem hw, which seems to be the main use-case for this work-around. --- drivers/tty/serial/amba-pl011.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index fb8809d7d04..a57efebe79b 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1107,6 +1107,10 @@ static void pl011_lockup_wa(unsigned long data) int buf_empty_retries = 200; int loop; + /* Exit early if there is no tty */ + if (!tty) + return; + /* Stop HCI layer from submitting data for tx */ tty->hw_stopped = 1; while (!uart_circ_empty(xmit)) { -- cgit v1.2.3