Skip to contentSkip to conversation

x86/kdump: fix wrong judge about crash_size var

PATCH In review Xin Hao 1 participant 2 messages Aug 13, 2021 – Aug 24, 2021 x86

lore
Share & tools
lore

Xin Hao

author
#0 lore raw

PATCH 1/1 x86/kdump: fix wrong judge about crash_size var

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

---
 arch/x86/kernel/setup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/setup.c +2 -2
index bff3a784aec5..95b80ec11741 100644
@@ -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

author
#1 lore raw

Hi,  everyone:

    Why nobody review this patch?

Quoted 28 lines · Xin Hao

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

---
  arch/x86/kernel/setup.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/setup.c +2 -3
index bff3a784aec5..95b80ec11741 100644
@@ -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

Signature · 2 lines
Best Regards!
Xin Hao