powerpc/fadump: reset dump area size if fadump memory reserve fails
authorSourabh Jain <sourabhjain@linux.ibm.com>
Tue, 4 Jul 2023 05:07:15 +0000 (10:37 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:47 +0000 (09:42 +0200)
[ Upstream commit d1eb75e0dfed80d2d85b664e28a39f65b290ab55 ]

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@linux.ibm.com>
Acked-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230704050715.203581-1-sourabhjain@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kernel/fadump.c

index ea0a073abd969b2b588b481826c5f4b34a205b01..3ff2da7b120b5090fe041efdebaf359bf2e32348 100644 (file)
@@ -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;
 }