From: "Li, Zhen-Hua" <zhen-hual@hp.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>, <linux-kernel@vger.kernel.org>
Cc: "Li, Zhen-Hua" <zhen-hual@hp.com>
Subject: [PATCH 1/1] drivers/tty: Fix missed unlocks for tty_release
Date: Mon, 9 Dec 2013 11:20:28 +0800 [thread overview]
Message-ID: <1386559228-26880-1-git-send-email-zhen-hual@hp.com> (raw)
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
next reply other threads:[~2013-12-09 3:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-09 3:20 Li, Zhen-Hua [this message]
2013-12-09 4:13 ` Li, ZhenHua
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386559228-26880-1-git-send-email-zhen-hual@hp.com \
--to=zhen-hual@hp.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®