From: Chris Packham Date: Tue, 22 Oct 2019 07:05:25 +0000 (+1300) Subject: ARM: mvebu: don't dereference null bd pointer X-Git-Tag: baikal/mips/sdk5.9~683^2~1 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=7960b905c4437ffa3643ee67680d32c413b53a25;p=uboot.git 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 Reviewed-by: Stefan Roese --- diff --git a/arch/arm/mach-mvebu/dram.c b/arch/arm/mach-mvebu/dram.c index fa8c799a46..ba8ebc6288 100644 --- a/arch/arm/mach-mvebu/dram.c +++ b/arch/arm/mach-mvebu/dram.c @@ -281,16 +281,6 @@ int dram_init(void) 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()) dram_ecc_scrubbing();