public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hso serial throttled tty kref fix.
@ 2009-01-15 12:10 Denis Joseph Barrow
       [not found] ` <496F27B9.3030802-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Joseph Barrow @ 2009-01-15 12:10 UTC (permalink / raw)
  To: Linux Serial, Linux USB kernel mailing list,
	Linux netdev Mailing list

[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]

Hi,
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>
---
Index: linux-2.6/drivers/net/usb/hso.c
===================================================================
--- linux-2.6.orig/drivers/net/usb/hso.c	2009-01-15 12:45:09.000000000 +0100
+++ linux-2.6/drivers/net/usb/hso.c	2009-01-15 12:46:18.000000000 +0100
@@ -2040,8 +2040,10 @@
 			serial->curr_rx_urb_offset;
 		D1("data to push to tty");
 		while (write_length_remaining) {
-			if (test_bit(TTY_THROTTLED, &tty->flags))
+			if (test_bit(TTY_THROTTLED, &tty->flags)) {
+				tty_kref_put(tty);
 				return -1;
+			}
 			curr_write_len =  tty_insert_flip_string
 				(tty, urb->transfer_buffer +
 				 serial->curr_rx_urb_offset,
-- 
best regards,
D.J. Barrow

Linux Kernel Developer
Option NV, Gaston Geenslaan 14, 3001 Leuven, Belgium
 
T: +32 16 311 621
F: +32 16 207 164
d.barow@option.com
www.option.com

Disclaimer:
http://www.option.com/company/disclaimer.shtml

[-- Attachment #2: hso_tty_kref_fix.patch --]
[-- Type: text/x-diff, Size: 824 bytes --]

Fixes a missed tty_kref_put which is caused the driver
to fail to unloading when rmmoded if the hso serial port
ever gets throttled. 
Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
---
Index: linux-2.6/drivers/net/usb/hso.c
===================================================================
--- linux-2.6.orig/drivers/net/usb/hso.c	2009-01-15 12:45:09.000000000 +0100
+++ linux-2.6/drivers/net/usb/hso.c	2009-01-15 12:46:18.000000000 +0100
@@ -2040,8 +2040,10 @@
 			serial->curr_rx_urb_offset;
 		D1("data to push to tty");
 		while (write_length_remaining) {
-			if (test_bit(TTY_THROTTLED, &tty->flags))
+			if (test_bit(TTY_THROTTLED, &tty->flags)) {
+				tty_kref_put(tty);
 				return -1;
+			}
 			curr_write_len =  tty_insert_flip_string
 				(tty, urb->transfer_buffer +
 				 serial->curr_rx_urb_offset,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-15 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15 12:10 [PATCH] hso serial throttled tty kref fix Denis Joseph Barrow
     [not found] ` <496F27B9.3030802-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
2009-01-15 13:17   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox