[PATCH v2] powerpc/fadump: reset dump area size if fadump memory reserve fails

Sourabh Jain sourabhjain at linux.ibm.com
Tue Jul 4 15:07:15 AEST 2023


In case fadump_reserve_mem() fails to reserve memory, the
reserve_dump_area_size variable will retain the reserve area size. This
will lead to /sys/kernel/fadump/mem_reserved node displaying an incorrect
memory reserved by fadump.

To fix this problem, reserve dump area size variable is set to 0 if fadump
failed to reserve memory.

Fixes: 8255da95e545 ("powerpc/fadump: release all the memory above boot memory size")
Signed-off-by: Sourabh Jain <sourabhjain at linux.ibm.com>
Acked-by: Mahesh Salgaonkar <mahesh at linux.ibm.com>
---
Chnages form V1:
* Reset the dump area size within the error_out path to cover more
  failure cases. Furthermore, the commit description has been modified
  accordingly.
---
 arch/powerpc/kernel/fadump.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index f3166acab09b..5a07d0f9c7f0 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -654,6 +654,7 @@ int __init fadump_reserve_mem(void)
 	return ret;
 error_out:
 	fw_dump.fadump_enabled = 0;
+	fw_dump.reserve_dump_area_size = 0;
 	return 0;
 }
 
-- 
2.41.0



More information about the Linuxppc-dev mailing list