Skip to content

Commit a160eed

Browse files
AlexGhitipalmer-dabbelt
authored andcommitted
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 <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent aa27342 commit a160eed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void __init setup_bootmem(void)
131131
for_each_memblock(memory, reg) {
132132
phys_addr_t end = reg->base + reg->size;
133133

134-
if (reg->base <= vmlinux_end && vmlinux_end <= end) {
134+
if (reg->base <= vmlinux_start && vmlinux_end <= end) {
135135
mem_size = min(reg->size, (phys_addr_t)-PAGE_OFFSET);
136136

137137
/*

0 commit comments

Comments
 (0)