[PATCH] x86/kdump: fix wrong judge about crash_size var

From: Xin Hao
Date: Fri Aug 13 2021 - 03:13:03 EST


The type of crash_size is unsigned long long, so
it can not be less than 0, so there fix it.

Signed-off-by: Xin Hao <xhao@xxxxxxxxxxxxxxxxx>
---
arch/x86/kernel/setup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index bff3a784aec5..95b80ec11741 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -472,11 +472,11 @@ static void __init reserve_crashkernel(void)

/* crashkernel=XM */
ret = parse_crashkernel(boot_command_line, total_mem, &crash_size, &crash_base);
- if (ret != 0 || crash_size <= 0) {
+ if (ret != 0 || !crash_size) {
/* crashkernel=X,high */
ret = parse_crashkernel_high(boot_command_line, total_mem,
&crash_size, &crash_base);
- if (ret != 0 || crash_size <= 0)
+ if (ret != 0 || !crash_size)
return;
high = true;
}
--
2.31.0