]> git.karo-electronics.de Git - linux-beck.git/commitdiff
of: make sure of_alias is initialized before accessing it
authorLaurentiu Tudor <b10716@freescale.com>
Wed, 27 Aug 2014 14:09:39 +0000 (17:09 +0300)
committerGrant Likely <grant.likely@linaro.org>
Mon, 8 Sep 2014 14:57:26 +0000 (15:57 +0100)
Simply swap of_alias and of_chosen initialization so
that of_alias ends up read first. This must be done
because it is accessed couple of lines below when
trying to initialize the of_stdout using the alias
based legacy method.

[Fixes a752ee5 - tty: Update hypervisor tty drivers to
use core stdout parsing code]

Signed-off-by: Laurentiu Tudor <Laurentiu.Tudor@freescale.com>
[glikely: Don't move the 'if (!of_aliases)' test]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
drivers/of/base.c

index 7af64c48ca4213d8b48df374f523ba25a5a2c485..293ed4b687ba7265889002edcb4f01b7d7edfe21 100644 (file)
@@ -1859,6 +1859,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
 {
        struct property *pp;
 
+       of_aliases = of_find_node_by_path("/aliases");
        of_chosen = of_find_node_by_path("/chosen");
        if (of_chosen == NULL)
                of_chosen = of_find_node_by_path("/chosen@0");
@@ -1874,7 +1875,6 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
                        of_stdout = of_find_node_by_path(name);
        }
 
-       of_aliases = of_find_node_by_path("/aliases");
        if (!of_aliases)
                return;