All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Joseph Barrow <D.Barow@option.com>
To: Linux Serial <linux-serial@vger.kernel.org>,
	Linux USB kernel mailing list <linux-usb@vger.kernel.org>,
	Linux netdev Mailing list <netdev@vger.kernel.org>
Subject: [PATCH] hso serial throttled tty kref fix.
Date: Thu, 15 Jan 2009 13:10:33 +0100	[thread overview]
Message-ID: <496F27B9.3030802@option.com> (raw)

[-- 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,

             reply	other threads:[~2009-01-15 12:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 12:10 Denis Joseph Barrow [this message]
     [not found] ` <496F27B9.3030802-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
2009-01-15 13:17   ` [PATCH] hso serial throttled tty kref fix Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496F27B9.3030802@option.com \
    --to=d.barow@option.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.