lkml.org 
[lkml]   [2013]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] drivers/tty: Fix missed unlocks for tty_release
Date
In function tty_release, there are two unlock not called while
breaking from a while. This may cause problems.
This patch fixed this problem , adding the two unlocks before
break is called.

Signed-off-by: Li, Zhen-Hua <zhen-hual@hp.com>
---
drivers/tty/tty_io.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index c74a00a..d41b0da 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1777,9 +1777,11 @@ int tty_release(struct inode *inode, struct file *filp)
do_sleep++;
}
}
- if (!do_sleep)
+ if (!do_sleep) {
+ tty_unlock_pair(tty, o_tty);
+ mutex_unlock(&tty_mutex);
break;
-
+ }
printk(KERN_WARNING "%s: %s: read/write wait queue active!\n",
__func__, tty_name(tty, buf));
tty_unlock_pair(tty, o_tty);
--
1.8.4.3


\
 
 \ /
  Last update: 2013-12-09 04:41    [W:0.034 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site