public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drivers/tty: Fix missed unlocks for tty_release
@ 2013-12-09  3:20 Li, Zhen-Hua
  2013-12-09  4:13 ` Li, ZhenHua
  0 siblings, 1 reply; 2+ messages in thread
From: Li, Zhen-Hua @ 2013-12-09  3:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-kernel; +Cc: Li, Zhen-Hua

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] drivers/tty: Fix missed unlocks for tty_release
  2013-12-09  3:20 [PATCH 1/1] drivers/tty: Fix missed unlocks for tty_release Li, Zhen-Hua
@ 2013-12-09  4:13 ` Li, ZhenHua
  0 siblings, 0 replies; 2+ messages in thread
From: Li, ZhenHua @ 2013-12-09  4:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-kernel; +Cc: Li, Zhen-Hua

Hi,

I found it was incorrect. So please IGNORE this patch.
Sorry for that.


On 12/09/2013 11:20 AM, Li, Zhen-Hua wrote:
> 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);
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-09  4:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09  3:20 [PATCH 1/1] drivers/tty: Fix missed unlocks for tty_release Li, Zhen-Hua
2013-12-09  4:13 ` Li, ZhenHua

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox