From: Denis Joseph Barrow Date: Thu, 15 Jan 2009 13:31:24 +0000 (+0000) Subject: tty: Fix double grabbing of a spinlock X-Git-Tag: v2.6.29-rc2~69 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d45eb81c3e345fabaf27ef3ab437b85c0bf9fafa;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 9df04dd1332..e25a58f6ff6 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) {