[PATCH v2] arm: kdump: add invalid input check for 'crashkernel=0'

Austin Kim austindh.kim at gmail.com
Thu Mar 31 04:24:16 PDT 2022


From: Austin Kim <austin.kim at lge.com>

Add invalid input check expression when 'crashkernel=0' is specified 
running kdump.

Signed-off-by: Austin Kim <austin.kim at lge.com>
---
 arch/arm/kernel/setup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 039feb7cd590..1e8a50a97edf 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1004,7 +1004,8 @@ static void __init reserve_crashkernel(void)
 	total_mem = get_total_mem();
 	ret = parse_crashkernel(boot_command_line, total_mem,
 				&crash_size, &crash_base);
-	if (ret)
+	/* invalid value specified or crashkernel=0 */
+	if (ret || !crash_size)
 		return;
 
 	if (crash_base <= 0) {
-- 
2.20.1




More information about the linux-arm-kernel mailing list