tty: Fix double grabbing of a spinlock

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, January 15, 2009 - 6:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d45eb8...
Commit:     d45eb81c3e345fabaf27ef3ab437b85c0bf9fafa
Parent:     fe41cbb164a0dc55f3914a0e4cabe8240410157c
Author:     Denis Joseph Barrow <D.Barrow@option.com>
AuthorDate: Thu Jan 15 13:31:24 2009 +0000
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Thu Jan 15 12:48:36 2009 -0800

    tty: Fix double grabbing of a spinlock
    
    The HSO changes for kref introduced a recursive spinlock take. All
    functions which call put_rxbuf_data already have serial->serial_lock
    grabbed.
    
    [Comment to code added-AC]
    
    Signed-off-by: Denis Joseph Barrow <D.Barrow@option.com>
    Signed-off-by: Alan Cox <alan@redhat.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 drivers/net/usb/hso.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 9df04dd..e25a58f 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2044,9 +2044,8 @@ static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial)
 		return -2;
 	}
 
-	spin_lock(&serial->serial_lock);
+	/* All callers to put_rxbuf_data hold serial_lock */
 	tty = tty_kref_get(serial->tty);
-	spin_unlock(&serial->serial_lock);
 
 	/* Push data to tty */
 	if (tty) {
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
tty: Fix double grabbing of a spinlock, Linux Kernel Mailing ..., (Thu Jan 15, 6:59 pm)