From: Laurent Pinchart <laurentp@cse-semaphore.com>
To: linux-serial@vger.kernel.org
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH] Fix oops in the 8250 serial driver when accessing a removed device
Date: Tue, 22 Jul 2008 17:37:05 +0200 [thread overview]
Message-ID: <200807221737.06224.laurentp@cse-semaphore.com> (raw)
The 8250 serial driver allocates dummy devices for ISA serial ports and lets
userspace applications open them even when they are not present. That hack is
required by setserial to set the ISA serial ports I/O address.
When a plug-and-play 8250 device is detected, the driver reuses one of the
dummy ports. If that device is later removed, the port goes pack to the dummy
ports pool. The capabilities field is not reset, which causes a oops when
trying to access the port.
This patch resets the capabilities field when a 8250 device is unregistered.
Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
drivers/serial/8250.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index ef158c1..40eb91f 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2886,6 +2886,7 @@ void serial8250_unregister_port(int line)
uart->port.flags &= ~UPF_BOOT_AUTOCONF;
uart->port.type = PORT_UNKNOWN;
uart->port.dev = &serial8250_isa_devs->dev;
+ uart->capabilities = 0;
uart_add_one_port(&serial8250_reg, &uart->port);
} else {
uart->port.dev = NULL;
--
1.5.0
--
Laurent Pinchart
CSE Semaphore Belgium
Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium
T +32 (2) 387 42 59
F +32 (2) 387 42 75
next reply other threads:[~2008-07-22 15:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-22 15:37 Laurent Pinchart [this message]
2008-07-22 15:54 ` [PATCH] Fix oops in the 8250 serial driver when accessing a removed device Alan Cox
2008-07-22 16:31 ` Laurent Pinchart
2008-07-25 9:51 ` Russell King
2008-07-25 11:40 ` Laurent Pinchart
2008-07-25 11:57 ` Russell King
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=200807221737.06224.laurentp@cse-semaphore.com \
--to=laurentp@cse-semaphore.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-serial@vger.kernel.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