Thread (3 messages) 3 messages, 2 authors, 2011-09-22

Re: [PATCH: tty-next] TTY: serial: Move mutex_unlock in uart_close function

From: Greg KH <hidden>
Date: 2011-09-22 23:00:59

On Thu, Sep 22, 2011 at 03:43:30PM -0700, Greg KH wrote:
On Mon, Aug 29, 2011 at 03:43:36PM +0900, Nobuhiro Iwamatsu wrote:
quoted
When mutex_lock is not called, mutex_unlock is sometimes called.
This deletes unnecessary goto and makes modifications so that
mutex_unlock is called.
No you don't, your patch prevents mutex_unlock() from being called:
quoted
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1262,7 +1262,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
 
 	if (tty_hung_up_p(filp)) {
 		spin_unlock_irqrestore(&port->lock, flags);
-		goto done;
+		return;
Before this mutex_lock() was called, so we need to unlock it, yet you
just prevented that from happening.

So this patch is not correct at all, right?
Nevermind, I was looking at the wrong tree, your patch is correct, and
identical to what Jiri sent out after you did, so I'll take your
version, as you got it to me first.

Sorry for the noise and confusion.

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help