diff options
author | Alexandre Ghiti <alex@ghiti.fr> | 2020-02-17 00:28:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-25 08:25:48 +0100 |
commit | b557b2f00682ac04df75514c9e9d3ea43e3af675 (patch) | |
tree | 7cba03f7d2f72ba805a6bf135e2bf00cb34a907d /arch | |
parent | 1c2106d2d9c1e423f43e12f3c90c19b21aa4c006 (diff) | |
download | linux-stable-b557b2f00682ac04df75514c9e9d3ea43e3af675.tar.gz linux-stable-b557b2f00682ac04df75514c9e9d3ea43e3af675.tar.bz2 linux-stable-b557b2f00682ac04df75514c9e9d3ea43e3af675.zip |
riscv: Fix range looking for kernel image memblock
[ Upstream commit a160eed4b783d7b250a32f7e5787c9867abc5686 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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 573463d1c799..f5d813c1304d 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -98,7 +98,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); /* |