Skip to content

Commit

Permalink
tty: Fix double grabbing of a spinlock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Denis Joseph Barrow authored and Linus Torvalds committed Jan 15, 2009
1 parent fe41cbb commit d45eb81
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d45eb81

Please sign in to comment.