Skip to contentSkip to conversation

kexec: Fix omitting offset in extended crashkernel syntax

PATCH New Hidetoshi Seto 1 participant 1 message Jul 14, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec: Fix omitting offset in extended crashkernel syntax

Setting
"crashkernel=512M-2G:64M,2G-:128M"
does not work but it turns to work if it has a trailing-whitespace, like
"crashkernel=512M-2G:64M,2G-:128M ".

It was because of a bug in the parser, running over the cmdline.

This patch adds a check of the termination.

---
 kernel/kexec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/kexec.c +1 -1
index ae1c352..f336e21 100644
@@ -1228,7 +1228,7 @@ static int __init parse_crashkernel_mem(char 			*cmdline,
 	} while (*cur++ == ',');
 
 	if (*crash_size > 0) {
-		while (*cur != ' ' && *cur != '@')
+		while (*cur && *cur != ' ' && *cur != '@')
 			cur++;
 		if (*cur == '@') {
 			cur++;
Signature · 1 line
1.6.0