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>
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;
}
}
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();