summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2006-07-27 11:24:48 -0600
committerEric W. Biederman <ebiederm@xmission.com>2006-07-27 11:24:48 -0600
commit6183c476f8203a18ee2dc35b4d611078bb5bbe12 (patch)
treebe46e3200cac825280441e40c0cf493ac0e64541
parent1387ae740abf3a86e5dded8c9c70f686e949409a (diff)
ppc64 fix segv when missing root option
If the first kernel command line or the --command-line parameter doesn't have a 'root=', we seg fault on ppc64. Patch below is against Maneesh's kexec-tools-1.101-kdump8 patches. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
-rw-r--r--kexec/arch/ppc64/fs2dt.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kexec/arch/ppc64/fs2dt.c b/kexec/arch/ppc64/fs2dt.c
index 2b81402..5256bc0 100644
--- a/kexec/arch/ppc64/fs2dt.c
+++ b/kexec/arch/ppc64/fs2dt.c
@@ -262,10 +262,12 @@ void putprops(char *fn, DIR *dir)
char *old_param;
memcpy(temp_cmdline, dt, len);
param = strstr(temp_cmdline, "root=");
- old_param = strtok(param, " ");
- if (cmd_len != 0)
- strcat(local_cmdline, " ");
- strcat(local_cmdline, old_param);
+ if (param) {
+ old_param = strtok(param, " ");
+ if (cmd_len != 0)
+ strcat(local_cmdline, " ");
+ strcat(local_cmdline, old_param);
+ }
}
strcat(local_cmdline, " ");
cmd_len = strlen(local_cmdline);