diff options
author | Alexandre Ghiti <alex@ghiti.fr> | 2020-02-17 00:28:47 -0500 |
---|---|---|
committer | Palmer Dabbelt <palmerdabbelt@google.com> | 2020-03-04 15:11:03 -0800 |
commit | a160eed4b783d7b250a32f7e5787c9867abc5686 (patch) | |
tree | 59183deec4b7f02bba486729c23596f4128dc29d /arch | |
parent | aa2734202acc506d09c8e641db4da161f902df27 (diff) | |
download | linux-a160eed4b783d7b250a32f7e5787c9867abc5686.tar.bz2 |
riscv: Fix range looking for kernel image memblock
When looking for the memblock where the kernel lives, we should check
that the memory range associated to the memblock entirely comprises the
kernel image and not only intersects with it.
Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/riscv/mm/init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 965a8cf4829c..fab855963c73 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -131,7 +131,7 @@ void __init setup_bootmem(void) for_each_memblock(memory, reg) { phys_addr_t end = reg->base + reg->size; - if (reg->base <= vmlinux_end && vmlinux_end <= end) { + if (reg->base <= vmlinux_start && vmlinux_end <= end) { mem_size = min(reg->size, (phys_addr_t)-PAGE_OFFSET); /* |