summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-01-17 17:42:03 -0500
committerTom Rini <trini@konsulko.com>2019-01-17 17:42:03 -0500
commite964df1e2ae7b2c041a9d767f03ad2b72a3f2ac7 (patch)
tree20fc239128010116c5034692afd9a82fb1ba0fa3 /arch/arm
parentaac0c29d4b8418c5c78b552070ffeda022b16949 (diff)
parentf8878da5571e5a1170f9c49214be5bafbc1b23a4 (diff)
Merge branch '2019-01-16-master-imports'
- Fixes for CVE-2018-18440 and CVE-2018-18439 - Patch to allow disabling unneeded NAND ECC layouts - Optimize SPI flash env read process
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/lib/bootm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index c3c1d2fdfa..329f20c2bf 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -64,13 +64,15 @@ void arch_lmb_reserve(struct lmb *lmb)
/* adjust sp by 4K to be safe */
sp -= 4096;
for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
- if (sp < gd->bd->bi_dram[bank].start)
+ if (!gd->bd->bi_dram[bank].size ||
+ sp < gd->bd->bi_dram[bank].start)
continue;
+ /* Watch out for RAM at end of address space! */
bank_end = gd->bd->bi_dram[bank].start +
- gd->bd->bi_dram[bank].size;
- if (sp >= bank_end)
+ gd->bd->bi_dram[bank].size - 1;
+ if (sp > bank_end)
continue;
- lmb_reserve(lmb, sp, bank_end - sp);
+ lmb_reserve(lmb, sp, bank_end - sp + 1);
break;
}
}