linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: default machine descriptor for multiplatform
Date: Fri, 19 Apr 2013 14:28:49 +0100	[thread overview]
Message-ID: <20130419132848.GO14496@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1365779468-116419-1-git-send-email-arnd@arndb.de>

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.

  parent reply	other threads:[~2013-04-19 13:28 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 ` Russell King - ARM Linux [this message]
2013-04-19 14:21   ` [PATCH 1/2] ARM: default machine descriptor for multiplatform Arnd Bergmann
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=20130419132848.GO14496@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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 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).