summaryrefslogtreecommitdiffstats
path: root/drivers/serial/kgdboc.c
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2008-02-15 14:55:52 -0600
committerIngo Molnar <mingo@elte.hu>2008-04-17 20:05:38 +0200
commitc191e5ad6b3fd8cc84b2b6d62c02fcd6837c8a8f (patch)
tree4f67c63ace026025f7265d298b29cd4da237c810 /drivers/serial/kgdboc.c
parent6cdf6e06d70dcf42314edb2c43b7c7ebc56e32e5 (diff)
downloadop-kernel-dev-c191e5ad6b3fd8cc84b2b6d62c02fcd6837c8a8f.zip
op-kernel-dev-c191e5ad6b3fd8cc84b2b6d62c02fcd6837c8a8f.tar.gz
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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/serial/kgdboc.c b/drivers/serial/kgdboc.c
index 3418307..9cf0332 100644
--- a/drivers/serial/kgdboc.c
+++ b/drivers/serial/kgdboc.c
@@ -106,7 +106,9 @@ static void kgdboc_put_char(u8 chr)
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");
return -ENOSPC;
}
@@ -125,6 +127,9 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp)
}
strcpy(config, kmessage);
+ /* Chop out \n char as a result of echo */
+ if (config[len - 1] == '\n')
+ config[len - 1] = '\0';
if (configured == 1)
cleanup_kgdboc();
OpenPOWER on IntegriCloud