All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Gevaerts <frank.gevaerts@fks.be>
To: "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>
Cc: Frank Gevaerts <frank.gevaerts@fks.be>, Mark Lord <lkml@rtr.ca>,
	Greg KH <gregkh@suse.de>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] clean tty fields on failed device open
Date: Wed, 14 Jun 2006 15:52:05 +0200	[thread overview]
Message-ID: <20060614135205.GA5814@fks.be> (raw)
In-Reply-To: <20060614104918.09fc175a@doriath.conectiva>

On Wed, Jun 14, 2006 at 10:49:18AM -0300, Luiz Fernando N. Capitulino wrote:
>  Hmm, I'd prefer something like this:

OK

If either the driver's open() method or try_module_get() fails, we need to
set 'tty->driver_data' and 'port->tty' to NULL in serial_open(), otherwise
we'll get an OOPS in usb_device_disconnect() when the device is disconnected.

Signed-off-by: Frank Gevaerts <frank.gevaerts@fks.be>

diff -urp linux-2.6.17-rc6/drivers/usb/serial/usb-serial.c linux-2.6.17-rc6.a/drivers/usb/serial/usb-serial.c
--- linux-2.6.17-rc6/drivers/usb/serial/usb-serial.c	2006-06-14 13:03:55.000000000 +0200
+++ linux-2.6.17-rc6.a/drivers/usb/serial/usb-serial.c	2006-06-14 13:23:34.000000000 +0200
@@ -230,6 +232,8 @@ bailout_module_put:
 	module_put(serial->type->driver.owner);
 bailout_mutex_unlock:
 	port->open_count = 0;
+	tty->driver_data = NULL;
+	port->tty = NULL;
 	mutex_unlock(&port->mutex);
 bailout_kref_put:
 	kref_put(&serial->kref, destroy_serial);

-- 
Frank Gevaerts                                 frank.gevaerts@fks.be
fks bvba - Formal and Knowledge Systems        http://www.fks.be/
Stationsstraat 108                             Tel:  ++32-(0)11-21 49 11
B-3570 ALKEN                                   Fax:  ++32-(0)11-22 04 19

  reply	other threads:[~2006-06-14 13:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-12 20:06 pl2303 ttyUSB0: pl2303_open - failed submitting interrupt urb, error -28 Mark Lord
2006-06-12 20:20 ` Mark Lord
2006-06-12 20:26 ` Lee Revell
2006-06-12 20:41 ` Mark Lord
2006-06-12 20:49 ` Greg KH
2006-06-12 20:56   ` Mark Lord
2006-06-12 21:15   ` Mark Lord
2006-06-12 21:28     ` Greg KH
2006-06-12 21:36       ` Mark Lord
2006-06-12 21:54       ` Mark Lord
2006-06-12 22:03         ` Greg KH
2006-06-12 22:12           ` Mark Lord
2006-06-12 22:23             ` Greg KH
2006-06-12 23:15               ` Mark Lord
2006-06-12 23:21                 ` Mark Lord
2006-06-13 11:46                   ` Frank Gevaerts
2006-06-13 16:26                     ` Luiz Fernando N. Capitulino
2006-06-13 17:45                       ` Luiz Fernando N. Capitulino
2006-06-14 11:52                         ` [PATCH] clean tty fields on failed device open Frank Gevaerts
2006-06-14 13:49                           ` Luiz Fernando N. Capitulino
2006-06-14 13:52                             ` Frank Gevaerts [this message]
2006-06-14 14:13                               ` Luiz Fernando N. Capitulino

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=20060614135205.GA5814@fks.be \
    --to=frank.gevaerts@fks.be \
    --cc=akpm@osdl.org \
    --cc=gregkh@suse.de \
    --cc=lcapitulino@mandriva.com.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@rtr.ca \
    /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.