[PATCH 7/8] tty: Fix double grabbing of a spinlock

From: Alan Cox
Date: Thu Jan 15 2009 - 08:32:52 EST


From: Denis Joseph Barrow <D.Barrow@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Alan Cox <alan@xxxxxxxxxx>
---

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 linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/