summaryrefslogtreecommitdiffstats
path: root/drivers/char/esp.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-04-30 00:53:50 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 08:29:44 -0700
commitd3ceb6562bfbe8f27fa32d1e24eea0e2d4de0347 (patch)
tree25a213062b9dd40361984a83f7b2c16a5e5edf8c /drivers/char/esp.c
parentf5592268a5aa5e02f36f396de47c94a1506e3678 (diff)
downloadlinux-d3ceb6562bfbe8f27fa32d1e24eea0e2d4de0347.tar.gz
linux-d3ceb6562bfbe8f27fa32d1e24eea0e2d4de0347.tar.bz2
linux-d3ceb6562bfbe8f27fa32d1e24eea0e2d4de0347.zip
char: esp.c: fix possible double-unlock
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 <harvey.harrison@gmail.com> Cc: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/esp.c')
-rw-r--r--drivers/char/esp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/esp.c b/drivers/char/esp.c
index 763d6d2e4b62..662e9cfdcc96 100644
--- a/drivers/char/esp.c
+++ b/drivers/char/esp.c
@@ -2040,10 +2040,10 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
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);