All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: default machine descriptor for multiplatform
Date: Fri, 19 Apr 2013 16:21:54 +0200	[thread overview]
Message-ID: <201304191621.54681.arnd@arndb.de> (raw)
In-Reply-To: <20130419132848.GO14496@n2100.arm.linux.org.uk>

On Friday 19 April 2013, Russell King - ARM Linux wrote:
> On Fri, Apr 12, 2013 at 05:11:07PM +0200, Arnd Bergmann wrote:
> > @@ -752,7 +761,7 @@ void __init setup_arch(char **cmdline_p)
> >  
> >       setup_processor();
> >       mdesc = setup_machine_fdt(__atags_pointer);
> > -     if (!mdesc)
> > +     if (!mdesc && __machine_arch_type != ~0)
> >               mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type);
> >       machine_desc = mdesc;
> >       machine_name = mdesc->name;
> 
> If mdesc is NULL and __machine_arch_type is ~0, then mdesc remains NULL.
> That means machine_desc is NULL (which is probably very bad), and the
> initialization of machine_name causes a NULL pointer dereference.
> 
> This is clearly wrong.  mdesc must never be NULL if you're using FDT
> here, so the original code should be fine.

Ah, right. I think was a leftover from an earlier version of the
patch where I only assigned the default platform after this.

There is also a related mistake in setup_machine_fdt, the second
change is not needed there either AFAICT.

Thanks for taking a look!

	Arnd

  reply	other threads:[~2013-04-19 14:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 15:11 [PATCH 1/2] ARM: default machine descriptor for multiplatform Arnd Bergmann
2013-04-12 15:11 ` [PATCH 2/2] ARM: remove all trivial init_machine callbacks Arnd Bergmann
2013-04-12 15:19   ` Arnd Bergmann
2013-04-12 15:40   ` Stephen Warren
2013-04-12 16:03     ` Arnd Bergmann
2013-04-12 16:08   ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-19 13:28 ` [PATCH 1/2] ARM: default machine descriptor for multiplatform Russell King - ARM Linux
2013-04-19 14:21   ` Arnd Bergmann [this message]
2013-04-19 14:40     ` [PATCH v3] " Arnd Bergmann
2013-04-19 21:32       ` Rob Herring
2013-04-19 21:54         ` Arnd Bergmann
2013-04-19 22:22           ` Rob Herring
2013-04-19 23:11             ` 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=201304191621.54681.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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.