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 2/3] Fix oops when closing ACM tty device right after open has failed.
Date: Wed, 24 Jun 2009 18:33:30 -0300 [thread overview]
Message-ID: <1245879211-10130-2-git-send-email-cascardo@holoscopio.com> (raw)
In-Reply-To: <1245879211-10130-1-git-send-email-cascardo@holoscopio.com>
This commit 10077d4a6674f535abdbe25cdecb1202af7948f1 has stopped
checking if there was a valid acm device associated to the tty, which is
not true right after open fails and tty subsystem tries to close the
device.
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/class/cdc-acm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 02eb60b..3f10459 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -677,7 +677,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
/* Perform the closing process and see if we need to do the hardware
shutdown */
- if (tty_port_close_start(&acm->port, tty, filp) == 0)
+ if (!acm || tty_port_close_start(&acm->port, tty, filp) == 0)
return;
acm_port_down(acm, 0);
tty_port_close_end(&acm->port, tty);
--
1.6.3
next prev parent reply other threads:[~2009-06-24 21:33 UTC|newest]
Thread overview: 8+ 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 ` Thadeu Lima de Souza Cascardo [this message]
2009-06-24 21:32 ` [PATCH 2/3] Fix oops when closing ACM tty device right after open has failed Greg KH
2009-06-24 21:33 ` [PATCH 3/3] Fix oops when unexisting usb serial device is opened Thadeu Lima de Souza Cascardo
-- 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 20:41 ` Greg KH
2009-06-24 21:35 ` Thadeu Lima de Souza Cascardo
2009-06-24 21:37 ` 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-2-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®