* [PATCH] kexec ppc64: fix segv when missing root= on cmdline
@ 2006-05-30 5:02 Michael Neuling
0 siblings, 0 replies; only message in thread
From: Michael Neuling @ 2006-05-30 5:02 UTC (permalink / raw)
To: linuxppc-dev, Fastboot mailing list; +Cc: miltonm
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>
--
kexec/arch/ppc64/fs2dt.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: kexec-tools-1.101/kexec/arch/ppc64/fs2dt.c
===================================================================
--- kexec-tools-1.101.orig/kexec/arch/ppc64/fs2dt.c
+++ kexec-tools-1.101/kexec/arch/ppc64/fs2dt.c
@@ -267,10 +267,12 @@ void putprops(char *fn, struct dirent **
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-30 5:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-30 5:02 [PATCH] kexec ppc64: fix segv when missing root= on cmdline Michael Neuling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).