diff options
author | Kalle Vahlman <kalle.vahlman@movial.com> | 2012-02-17 08:32:03 +0100 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-02-17 10:37:00 +0100 |
commit | 2ccbaaae5303606041b010ba39774b900a68b86a (patch) | |
tree | fd7d6357f11beb0bd1e19bc6d0156c5d088f4e7e | |
parent | 3e18d1bb698aa4e992e548007c2ca050aeedb2e5 (diff) |
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.
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 23b1bbe581a..09a02f32a17 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)) { |