public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Cc: benh@kernel.crashing.org, Patrick Mochel <mochel@osdl.org>
Subject: [PATCH] Fix oopses with usb-serial devices (2.6.0-test4)
Date: Fri, 29 Aug 2003 13:43:59 -0700	[thread overview]
Message-ID: <20030829204359.GA2601@kroah.com> (raw)

Hi,

Below is a small patch that fixes the oops that happens in the latest
2.6 kernels when you plug in a keyspan or whiteheat usb to serial
device.  Thanks to Ben for pointing out that there is a problem, and to
Pat for finding where the problem was (in my code, not his :)

I'll be sending it on to Linus next week, but here is is for those
people who want to use their devices again.

thanks,

greg k-h


# USB: fix oops in keyspan and whiteheat devices when plugged in.

diff -Nru a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
--- a/drivers/usb/serial/usb-serial.c	Fri Aug 29 13:39:11 2003
+++ b/drivers/usb/serial/usb-serial.c	Fri Aug 29 13:39:11 2003
@@ -871,7 +871,8 @@
 
 	/* the ports are cleaned up and released in port_release() */
 	for (i = 0; i < serial->num_ports; ++i)
-		device_unregister(&serial->port[i]->dev);
+		if (serial->port[i]->dev.parent != NULL)
+			device_unregister(&serial->port[i]->dev);
 
 	/* If this is a "fake" port, we have to clean it up here, as it will
 	 * not get cleaned up in port_release() as it was never registered with

                 reply	other threads:[~2003-08-29 20:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20030829204359.GA2601@kroah.com \
    --to=greg@kroah.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=mochel@osdl.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