diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 5bd382e..3c0231a 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -1527,6 +1527,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
{
struct async_struct * info = tty->driver_data;
unsigned long orig_jiffies, char_time;
+ int tty_was_locked = tty_locked();
int lsr;
if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
@@ -1578,7 +1584,8 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
break;
}
__set_current_state(TASK_RUNNING);
- tty_unlock();
+ if (!tty_was_locked())