Commit c191e5ad authored by Jason Wessel's avatar Jason Wessel Committed by Ingo Molnar

kgdb: fix kgdboc dynamic module configuration

Fix the run time configuration of kgdboc such that it does not default
to 9600 baud if you use the "echo" command to configure the sysfs
module paramater.
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 6cdf6e06
...@@ -106,7 +106,9 @@ static void kgdboc_put_char(u8 chr) ...@@ -106,7 +106,9 @@ static void kgdboc_put_char(u8 chr)
static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp)
{ {
if (strlen(kmessage) >= MAX_CONFIG_LEN) { int len = strlen(kmessage);
if (len >= MAX_CONFIG_LEN) {
printk(KERN_ERR "kgdboc: config string too long\n"); printk(KERN_ERR "kgdboc: config string too long\n");
return -ENOSPC; return -ENOSPC;
} }
...@@ -125,6 +127,9 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) ...@@ -125,6 +127,9 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp)
} }
strcpy(config, kmessage); strcpy(config, kmessage);
/* Chop out \n char as a result of echo */
if (config[len - 1] == '\n')
config[len - 1] = '\0';
if (configured == 1) if (configured == 1)
cleanup_kgdboc(); cleanup_kgdboc();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment