Skip to content

Commit

Permalink
of: make sure of_alias is initialized before accessing it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Laurentiu Tudor authored and Grant Likely committed Sep 8, 2014
1 parent b9c74fd commit 7dbe584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;

Expand Down

0 comments on commit 7dbe584

Please sign in to comment.