Skip to content
Snippets Groups Projects
Commit 15c2e2c0 authored by Igor Grinberg's avatar Igor Grinberg Committed by Albert ARIBAUD
Browse files

arm: fix bd pointer dereference prior initialization


gd->bd pointer has been used prior been initialized.
Move the relevant code after the initialization.

Signed-off-by: default avatarIgor Grinberg <grinberg@compulab.co.il>
parent b2b8f98f
Branches
Tags
No related merge requests found
...@@ -275,10 +275,6 @@ void board_init_f(ulong bootflag) ...@@ -275,10 +275,6 @@ void board_init_f(ulong bootflag)
gd->mon_len = _bss_end_ofs; gd->mon_len = _bss_end_ofs;
#ifdef CONFIG_MACH_TYPE
gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
#endif
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr)() != 0) { if ((*init_fnc_ptr)() != 0) {
hang (); hang ();
...@@ -376,6 +372,11 @@ void board_init_f(ulong bootflag) ...@@ -376,6 +372,11 @@ void board_init_f(ulong bootflag)
gd->bd = bd; gd->bd = bd;
debug("Reserving %zu Bytes for Board Info at: %08lx\n", debug("Reserving %zu Bytes for Board Info at: %08lx\n",
sizeof (bd_t), addr_sp); sizeof (bd_t), addr_sp);
#ifdef CONFIG_MACH_TYPE
gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
#endif
addr_sp -= sizeof (gd_t); addr_sp -= sizeof (gd_t);
id = (gd_t *) addr_sp; id = (gd_t *) addr_sp;
debug("Reserving %zu Bytes for Global Data at: %08lx\n", debug("Reserving %zu Bytes for Global Data at: %08lx\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment