]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
kgdb: fix kgdboc dynamic module configuration
authorJason Wessel <jason.wessel@windriver.com>
Fri, 15 Feb 2008 20:55:52 +0000 (14:55 -0600)
committerIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 18:05:38 +0000 (20:05 +0200)
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>
drivers/serial/kgdboc.c

index 341830791608796f88633dda02c531c0ed0318b9..9cf03327386acce3b382b7d63c579546b5ff0dd4 100644 (file)
@@ -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();