瀏覽代碼

hso serial throttled tty kref fix.

This patch is for Alan Cox as it related to the tty layer.
Hopefully the hso driver is again relatively stable with this fix.

Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Denis Joseph Barrow 16 年之前
父節點
當前提交
5839b414f9
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/net/usb/hso.c

+ 3 - 1
drivers/net/usb/hso.c

@@ -2053,8 +2053,10 @@ static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial)
 			serial->curr_rx_urb_offset;
 			serial->curr_rx_urb_offset;
 		D1("data to push to tty");
 		D1("data to push to tty");
 		while (write_length_remaining) {
 		while (write_length_remaining) {
-			if (test_bit(TTY_THROTTLED, &tty->flags))
+			if (test_bit(TTY_THROTTLED, &tty->flags)) {
+				tty_kref_put(tty);
 				return -1;
 				return -1;
+			}
 			curr_write_len =  tty_insert_flip_string
 			curr_write_len =  tty_insert_flip_string
 				(tty, urb->transfer_buffer +
 				(tty, urb->transfer_buffer +
 				 serial->curr_rx_urb_offset,
 				 serial->curr_rx_urb_offset,