From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] serial console registration bugfix (2.6)
Date: Thu, 16 Oct 2003 16:58:56 +0000 [thread overview]
Message-ID: <marc-linux-ia64-106632357111519@msgid-missing> (raw)
uart_set_options() can dereference a null pointer. This happens
if you specify a console that hasn't previously been setup by
early_serial_setup().
For example, on ia64, the HCDP typically tells us about line 0,
so we calls early_serial_setup() for it. If the user specifies
"console=ttyS3", we machine-check when trying to follow the
uninitialized port->ops pointer.
It's not entirely clear to me whether we should return 0 or -ENODEV
or something. The advantage of returning zero is that if the user
specifies "console=ttyS0" and we just lack the HCDP, the console
doesn't work as early as usual, but it does start working after the
serial driver detects the port (though the baud/parity/etc from the
command line are lost). Returning -ENODEV seems to prevent it from
ever working.
Bjorn
=== drivers/serial/serial_core.c 1.72 vs edited ==--- 1.72/drivers/serial/serial_core.c Mon Sep 29 18:35:33 2003
+++ edited/drivers/serial/serial_core.c Thu Oct 16 09:56:55 2003
@@ -1859,6 +1859,9 @@
if (flow = 'r')
termios.c_cflag |= CRTSCTS;
+ if (!port->ops)
+ return 0;
+
port->ops->set_termios(port, &termios, NULL);
co->cflag = termios.c_cflag;
next reply other threads:[~2003-10-16 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-16 16:58 Bjorn Helgaas [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-10-16 16:58 [PATCH] serial console registration bugfix (2.6) Bjorn Helgaas
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=marc-linux-ia64-106632357111519@msgid-missing \
--to=bjorn.helgaas@hp.com \
--cc=linux-ia64@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 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.