From: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
To: linux-kernel@vger.kernel.org
Cc: alan@lxorguk.ukuu.org.uk, gregkh@suse.de,
linux-usb@vger.kernel.org, oliver@neukum.name,
Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Subject: [PATCH 3/3] Fix oops when unexisting usb serial device is opened.
Date: Wed, 24 Jun 2009 18:33:31 -0300 [thread overview]
Message-ID: <1245879211-10130-3-git-send-email-cascardo@holoscopio.com> (raw)
In-Reply-To: <1245879211-10130-2-git-send-email-cascardo@holoscopio.com>
This commit 335f8514f200e63d689113d29cb7253a5c282967 has stopped
properly checking if there is any usb serial associated with the tty in
the close function. It happens the close function is called by releasing
the terminal right after opening the device fails.
As an example, open fails with a non-existing device, when probe has
never been called, because the device has never been plugged. This is
common in systems with static modules and no udev.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
---
drivers/usb/serial/usb-serial.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index d595aa5..a842164 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -333,6 +333,9 @@ static void serial_close(struct tty_struct *tty, struct file *filp)
{
struct usb_serial_port *port = tty->driver_data;
+ if (!port)
+ return;
+
dbg("%s - port %d", __func__, port->number);
--
1.6.3
next prev parent reply other threads:[~2009-06-24 21:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-24 21:33 [PATCH 1/3] Return ENODEV instead of EINVAL when trying to open ACM device Thadeu Lima de Souza Cascardo
2009-06-24 21:33 ` [PATCH 2/3] Fix oops when closing ACM tty device right after open has failed Thadeu Lima de Souza Cascardo
2009-06-24 21:32 ` Greg KH
2009-06-24 21:33 ` Thadeu Lima de Souza Cascardo [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-06-24 11:31 [PATCH 1/3] Return ENODEV instead of EINVAL when trying to open ACM device Thadeu Lima de Souza Cascardo
2009-06-24 11:31 ` [PATCH 2/3] Fix oops when closing ACM tty device right after open has failed Thadeu Lima de Souza Cascardo
2009-06-24 11:31 ` [PATCH 3/3] Fix oops when unexisting usb serial device is opened Thadeu Lima de Souza Cascardo
2009-06-24 20:41 ` Greg KH
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=1245879211-10130-3-git-send-email-cascardo@holoscopio.com \
--to=cascardo@holoscopio.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oliver@neukum.name \
/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®