diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2008-02-15 15:55:52 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 14:05:38 -0400 |
commit | c191e5ad6b3fd8cc84b2b6d62c02fcd6837c8a8f (patch) | |
tree | 4f67c63ace026025f7265d298b29cd4da237c810 /drivers/serial/kgdboc.c | |
parent | 6cdf6e06d70dcf42314edb2c43b7c7ebc56e32e5 (diff) |
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: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/serial/kgdboc.c')
-rw-r--r-- | drivers/serial/kgdboc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/serial/kgdboc.c b/drivers/serial/kgdboc.c index 341830791608..9cf03327386a 100644 --- a/drivers/serial/kgdboc.c +++ b/drivers/serial/kgdboc.c | |||
@@ -106,7 +106,9 @@ static void kgdboc_put_char(u8 chr) | |||
106 | 106 | ||
107 | static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) | 107 | static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) |
108 | { | 108 | { |
109 | if (strlen(kmessage) >= MAX_CONFIG_LEN) { | 109 | int len = strlen(kmessage); |
110 | |||
111 | if (len >= MAX_CONFIG_LEN) { | ||
110 | printk(KERN_ERR "kgdboc: config string too long\n"); | 112 | printk(KERN_ERR "kgdboc: config string too long\n"); |
111 | return -ENOSPC; | 113 | return -ENOSPC; |
112 | } | 114 | } |
@@ -125,6 +127,9 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) | |||
125 | } | 127 | } |
126 | 128 | ||
127 | strcpy(config, kmessage); | 129 | strcpy(config, kmessage); |
130 | /* Chop out \n char as a result of echo */ | ||
131 | if (config[len - 1] == '\n') | ||
132 | config[len - 1] = '\0'; | ||
128 | 133 | ||
129 | if (configured == 1) | 134 | if (configured == 1) |
130 | cleanup_kgdboc(); | 135 | cleanup_kgdboc(); |