mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Helge Hafting <helge.hafting@aitel.hist.no>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Linux 2.6.28-rc2 i/o error on /dev/ttyUSB0
Date: Thu, 30 Oct 2008 15:54:12 +0000	[thread overview]
Message-ID: <20081030155412.33d57ca0@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <490856FA.20609@aitel.hist.no>

On Wed, 29 Oct 2008 13:28:42 +0100
Helge Hafting <helge.hafting@aitel.hist.no> wrote:

> Alan Cox wrote:
> >> squarely in the "oops, kref's are screwed up" corner, and you should talk 
> >> to Alan about your particular USB dongle. I bet that bisection would just 
> >> show you one of the kref commits (eg 4a90f09b "tty: usb-serial krefs" or 
> >> maybe 7d7b93c14 "tty: kref the tty driver object"). 

Please try:

tty: Fix USB kref leak

From: Alan Cox <alan@redhat.com>

When we close we must clear the extra reference we got when we read
port->tty. Setting the port tty NULL will clear the kref held by the driver
but not the one we obtained ourselves while doing the lookup.

Signed-off-by: Alan Cox <alan@redhat.com>
---

 drivers/usb/serial/usb-serial.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 8be3f39..794b5ff 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -281,6 +281,7 @@ static void serial_close(struct tty_struct *tty, struct file *filp)
 			if (tty->driver_data)
 				tty->driver_data = NULL;
 			tty_port_tty_set(&port->port, NULL);
+			tty_kref_put(tty);
 		}
 	}
 

  reply	other threads:[~2008-10-30 15:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-26 19:41 Linux 2.6.28-rc2 Linus Torvalds
2008-10-27 22:52 ` [2.6.28-rc2] EeePC ACPI errors & exceptions Darren Salt
2008-10-28  1:32   ` Zhao Yakui
2008-10-28  6:47   ` Zhao Yakui
2008-10-28  9:42   ` Zhao Yakui
2008-10-28 11:16     ` Darren Salt
2008-10-28 20:46       ` Alexey Starikovskiy
2008-10-29  0:37         ` Darren Salt
2008-10-29  7:39         ` Zhao Yakui
2008-10-29  9:29           ` Alexey Starikovskiy
2008-10-30  1:32             ` Zhao Yakui
2008-10-30  7:18               ` Alexey Starikovskiy
2008-10-28 11:19 ` Linux 2.6.28-rc2 i/o error on /dev/ttyUSB0 Helge Hafting
2008-10-28 16:37   ` Linus Torvalds
2008-10-28 17:06     ` Alan Cox
2008-10-29 12:28       ` Helge Hafting
2008-10-30 15:54         ` Alan Cox [this message]
2008-10-30 17:08           ` Helge Hafting
2008-10-30 17:22             ` Alan Cox
2008-10-30 13:50 ` Linux 2.6.28-rc2 lost IDE disk on old laptop Wolfgang Erig
2008-10-30 14:33   ` Borislav Petkov
2008-10-30 17:58     ` Linux 2.6.28-rc2 lost IDE disk on old laptop fixed Wolfgang Erig

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=20081030155412.33d57ca0@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=helge.hafting@aitel.hist.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®