linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Grant Likely" <grant.likely@secretlab.ca>
To: "John Linn" <john.linn@xilinx.com>, "Paul Mackerras" <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 1/3][POWERPC][V2] of_serial: Fix possible null dereference.
Date: Wed, 2 Apr 2008 11:46:30 -0600	[thread overview]
Message-ID: <fa686aa40804021046n1bc0626ay6a3f9f2a251331ef@mail.gmail.com> (raw)
In-Reply-To: <20080402165216.8FD2BC9807F@mail21-dub.bigfish.com>

On Wed, Apr 2, 2008 at 10:52 AM, John Linn <john.linn@xilinx.com> wrote:
> From: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
>
>  The of_serial driver queries the current-speed property and attempts
>  to use it to register the custom_divisor property of the uart_port.
>  However, if current-speed is not set, then this code will dereference
>  a bad pointer.  The fix is to only set custom_divisor when a
>  current-speed property appears in the device tree.
>
>  Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
>  Signed-off-by: John Linn <john.linn@xilinx.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>

Paul, can you please pick this one up for .25?  It is pure bug fix.

Thanks,
g.

>  ---
>   drivers/serial/of_serial.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>
>  diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c
>  index a64d858..2efb892 100644
>  --- a/drivers/serial/of_serial.c
>  +++ b/drivers/serial/of_serial.c
>  @@ -56,7 +56,9 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
>         port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP
>                 | UPF_FIXED_PORT;
>         port->dev = &ofdev->dev;
>  -       port->custom_divisor = *clk / (16 * (*spd));
>  +       /* If current-speed was set, then try not to change it. */
>  +       if (spd)
>  +               port->custom_divisor = *clk / (16 * (*spd));
>
>         return 0;
>   }
>  --
>  1.5.2.1
>
>
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  reply	other threads:[~2008-04-02 17:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-02 16:52 [PATCH 1/3][POWERPC][V2] of_serial: Fix possible null dereference John Linn
2008-04-02 17:46 ` Grant Likely [this message]
2008-04-02 23:39   ` Arnd Bergmann
2008-04-03  0:56     ` Josh Boyer
2008-04-03  2:18       ` Arnd Bergmann

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=fa686aa40804021046n1bc0626ay6a3f9f2a251331ef@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=john.linn@xilinx.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).