aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/serial/kgdboc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
index baeeeaec3f03..6fb312e7af71 100644
--- a/drivers/tty/serial/kgdboc.c
+++ b/drivers/tty/serial/kgdboc.c
@@ -233,7 +233,7 @@ static void kgdboc_put_char(u8 chr)
233static int param_set_kgdboc_var(const char *kmessage, 233static int param_set_kgdboc_var(const char *kmessage,
234 const struct kernel_param *kp) 234 const struct kernel_param *kp)
235{ 235{
236 int len = strlen(kmessage); 236 size_t len = strlen(kmessage);
237 237
238 if (len >= MAX_CONFIG_LEN) { 238 if (len >= MAX_CONFIG_LEN) {
239 pr_err("config string too long\n"); 239 pr_err("config string too long\n");
@@ -254,7 +254,7 @@ static int param_set_kgdboc_var(const char *kmessage,
254 254
255 strcpy(config, kmessage); 255 strcpy(config, kmessage);
256 /* Chop out \n char as a result of echo */ 256 /* Chop out \n char as a result of echo */
257 if (config[len - 1] == '\n') 257 if (len && config[len - 1] == '\n')
258 config[len - 1] = '\0'; 258 config[len - 1] = '\0';
259 259
260 if (configured == 1) 260 if (configured == 1)