From: Andrew Morton <akpm@linux-foundation.org>
To: izumi <izumi2005@soft.fujitsu.com>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
kaneshige.kenji@jp.fujitsu.com
Subject: Re: [PATCH][BUG] Fix possible NULL pointer access in 8250 serial driver
Date: Wed, 18 Apr 2007 22:08:12 -0700 [thread overview]
Message-ID: <20070418220812.b809c8fb.akpm@linux-foundation.org> (raw)
In-Reply-To: <4626D3D5.2060408@soft.fujitsu.com>
On Thu, 19 Apr 2007 11:28:37 +0900 izumi <izumi2005@soft.fujitsu.com> wrote:
> Russell King wrote:
>
> > NAK. This means that you change the list of ports available on the
> > machine to be limited to only those which are currently open. Utterly
> > useless for debugging, where you normally want people to dump the
> > contents of /proc/tty/driver/*.
> >
> > The original patch was better.
> >
>
> Is the original patch sufficient? or is there anything we should
> correct?
>
Would it be better to do something like
--- a/drivers/serial/serial_core.c~a
+++ a/drivers/serial/serial_core.c
@@ -1686,9 +1686,12 @@ static int uart_line_info(char *buf, str
pm_state = state->pm_state;
if (pm_state)
uart_change_pm(state, 0);
- spin_lock_irq(&port->lock);
- status = port->ops->get_mctrl(port);
- spin_unlock_irq(&port->lock);
+ status = 0;
+ if (port->info) {
+ spin_lock_irq(&port->lock);
+ status = port->ops->get_mctrl(port);
+ spin_unlock_irq(&port->lock);
+ }
if (pm_state)
uart_change_pm(state, pm_state);
mutex_unlock(&state->mutex);
_
so that a) we treat all uart types in the same way and b) the same problem
doesn't occur later with some other driver which is assuming an opened
device in its ->get_mctrl() handler?
prev parent reply other threads:[~2007-04-19 5:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-17 2:15 [PATCH][BUG] Fix possible NULL pointer access in 8250 serial driver izumi
2007-04-17 5:52 ` Andrew Morton
2007-04-18 8:21 ` Kenji Kaneshige
2007-04-18 16:16 ` Andrew Morton
2007-04-18 19:18 ` Russell King
2007-04-19 2:28 ` izumi
2007-04-19 5:08 ` Andrew Morton [this message]
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=20070418220812.b809c8fb.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=izumi2005@soft.fujitsu.com \
--cc=kaneshige.kenji@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).