提交 d45eb81c 编写于 作者: D Denis Joseph Barrow 提交者: Linus Torvalds

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: NDenis Joseph Barrow <D.Barrow@option.com>
Signed-off-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 fe41cbb1
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册