RISC-V: Fix memblock_free() usages in init_resources()
PATCH 1/1 RISC-V: Fix memblock_free() usages in init_resources()
memblock_free() takes a physical address as its first argument. Fix the wrong usages in init_resources().
Fixes ffe0e526126884cf036a6f724220f1f9b4094fd2 ("RISC-V: Improve init_resources()")
Fixes 797f0375dd2ef5cdc68ac23450cbae9a5c67a74e ("RISC-V: Do not allocate memblock while iterating reserved memblocks")
Signed-off-by Wende Tan <[email protected]>
--- arch/riscv/kernel/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/setup.c +2 -2
@@ -231,13 +231,13 @@ static void __init init_resources(void)/* Clean-up any unused pre-allocated resources */ mem_res_sz = (num_resources - res_idx +1 ) *sizeof (*mem_res); -memblock_free ((phys_addr_t ) mem_res, mem_res_sz); +memblock_free (__pa (mem_res), mem_res_sz);return ; error:/* Better an empty resource tree than an inconsistent one */ release_child_resources (&iomem_resource); -memblock_free ((phys_addr_t ) mem_res, mem_res_sz); +memblock_free (__pa (mem_res), mem_res_sz); }
Signature · 7 lines
2.25.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Palmer Dabbelt
maintainerQuoted 18 lines · On Sat, 22 May 2021 10:49:51 PDT (-0700), [email protected] wrote:
memblock_free()takes a physical address as its first argument. Fix the wrong usages ininit_resources().Fixes ffe0e526126884cf036a6f724220f1f9b4094fd2 ("RISC-V: Improve init_resources()")Fixes 797f0375dd2ef5cdc68ac23450cbae9a5c67a74e ("RISC-V: Do not allocate memblock while iterating reserved memblocks")Signed-off-by Wende Tan <[email protected]>--- arch/riscv/kernel/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/riscv/kernel/setup.c +0
-0@@ -231,13 +231,13 @@ static void __init init_resources(void)/* Clean-up any unused pre-allocated resources */ mem_res_sz = (num_resources - res_idx +1 ) *sizeof (*mem_res);
arch/riscv/kernel/setup.c static void __init init_resources(void) · line 241
Quoted 10 lines
arch/riscv/kernel/setup.c +2
-2-memblock_free ((phys_addr_t ) mem_res, mem_res_sz); +memblock_free (__pa (mem_res), mem_res_sz);return ; error:/* Better an empty resource tree than an inconsistent one */ release_child_resources (&iomem_resource); -memblock_free ((phys_addr_t ) mem_res, mem_res_sz); +memblock_free (__pa (mem_res), mem_res_sz); }
Thanks, this is on fixes.
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv