aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Joseph Barrow <D.Barrow@option.com>2009-01-15 08:31:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-15 15:48:36 -0500
commitd45eb81c3e345fabaf27ef3ab437b85c0bf9fafa (patch)
tree46f3008a49f0c3dd167237419267d70626729e8c
parentfe41cbb164a0dc55f3914a0e4cabe8240410157c (diff)
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>
-rw-r--r--drivers/net/usb/hso.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 9df04dd1332c..e25a58f6ff69 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)
2044 return -2; 2044 return -2;
2045 } 2045 }
2046 2046
2047 spin_lock(&serial->serial_lock); 2047 /* All callers to put_rxbuf_data hold serial_lock */
2048 tty = tty_kref_get(serial->tty); 2048 tty = tty_kref_get(serial->tty);
2049 spin_unlock(&serial->serial_lock);
2050 2049
2051 /* Push data to tty */ 2050 /* Push data to tty */
2052 if (tty) { 2051 if (tty) {