From: Harvey Harrison Hitting either of the break statements in the while loop would cause a double-unlock of info->lock. [Jiri Slaby suggested simply returning is safe here, rather than a goto] Noticed by sparse: drivers/char/esp.c:2042:2: warning: context imbalance in 'rs_wait_until_sent' - unexpected unlock Signed-off-by: Harvey Harrison Cc: Jiri Slaby Signed-off-by: Andrew Morton --- drivers/char/esp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/char/esp.c~char-espc-fix-possible-double-unlock drivers/char/esp.c --- a/drivers/char/esp.c~char-espc-fix-possible-double-unlock +++ a/drivers/char/esp.c @@ -2040,10 +2040,10 @@ static void rs_wait_until_sent(struct tt msleep_interruptible(jiffies_to_msecs(char_time)); if (signal_pending(current)) - break; + return; if (timeout && time_after(jiffies, orig_jiffies + timeout)) - break; + return; spin_lock_irqsave(&info->lock, flags); serial_out(info, UART_ESI_CMD1, ESI_NO_COMMAND); _