mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-19 04:41:32 +00:00
ARM: mvebu: don't dereference null bd pointer
As mentioned in doc/README.arm-relocation gd->bd is not available in dram_init() so we shouldn't attempt to access it. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
3ff1ff3ff7
commit
2ec330fcc2
1 changed files with 0 additions and 10 deletions
|
@ -281,16 +281,6 @@ int dram_init(void)
|
||||||
size = MVEBU_SDRAM_SIZE_MAX;
|
size = MVEBU_SDRAM_SIZE_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; i < CONFIG_NR_DRAM_BANKS; i++) {
|
|
||||||
/* If above loop terminated prematurely, we need to set
|
|
||||||
* remaining banks' start address & size as 0. Otherwise other
|
|
||||||
* u-boot functions and Linux kernel gets wrong values which
|
|
||||||
* could result in crash */
|
|
||||||
gd->bd->bi_dram[i].start = 0;
|
|
||||||
gd->bd->bi_dram[i].size = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (ecc_enabled())
|
if (ecc_enabled())
|
||||||
dram_ecc_scrubbing();
|
dram_ecc_scrubbing();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue