Commit 822b7683 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'tty-4.20-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty driver fixes from Greg KH:
 "Here are three small tty driver fixes for 4.20-rc6

  Nothing major, just some bug fixes for reported issues. Full details
  are in the shortlog.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'tty-4.20-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  kgdboc: fix KASAN global-out-of-bounds bug in param_set_kgdboc_var()
  tty: serial: 8250_mtk: always resume the device in probe.
  tty: do not set TTY_IO_ERROR flag if console port
parents 50a5528a dada6a43
...@@ -213,17 +213,17 @@ static int mtk8250_probe(struct platform_device *pdev) ...@@ -213,17 +213,17 @@ static int mtk8250_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, data); platform_set_drvdata(pdev, data);
pm_runtime_enable(&pdev->dev); err = mtk8250_runtime_resume(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) { if (err)
err = mtk8250_runtime_resume(&pdev->dev); return err;
if (err)
return err;
}
data->line = serial8250_register_8250_port(&uart); data->line = serial8250_register_8250_port(&uart);
if (data->line < 0) if (data->line < 0)
return data->line; return data->line;
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
return 0; return 0;
} }
...@@ -234,13 +234,11 @@ static int mtk8250_remove(struct platform_device *pdev) ...@@ -234,13 +234,11 @@ static int mtk8250_remove(struct platform_device *pdev)
pm_runtime_get_sync(&pdev->dev); pm_runtime_get_sync(&pdev->dev);
serial8250_unregister_port(data->line); serial8250_unregister_port(data->line);
mtk8250_runtime_suspend(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev); pm_runtime_put_noidle(&pdev->dev);
if (!pm_runtime_status_suspended(&pdev->dev))
mtk8250_runtime_suspend(&pdev->dev);
return 0; return 0;
} }
......
...@@ -233,7 +233,7 @@ static void kgdboc_put_char(u8 chr) ...@@ -233,7 +233,7 @@ static void kgdboc_put_char(u8 chr)
static int param_set_kgdboc_var(const char *kmessage, static int param_set_kgdboc_var(const char *kmessage,
const struct kernel_param *kp) const struct kernel_param *kp)
{ {
int len = strlen(kmessage); size_t len = strlen(kmessage);
if (len >= MAX_CONFIG_LEN) { if (len >= MAX_CONFIG_LEN) {
pr_err("config string too long\n"); pr_err("config string too long\n");
...@@ -254,7 +254,7 @@ static int param_set_kgdboc_var(const char *kmessage, ...@@ -254,7 +254,7 @@ static int param_set_kgdboc_var(const char *kmessage,
strcpy(config, kmessage); strcpy(config, kmessage);
/* Chop out \n char as a result of echo */ /* Chop out \n char as a result of echo */
if (config[len - 1] == '\n') if (len && config[len - 1] == '\n')
config[len - 1] = '\0'; config[len - 1] = '\0';
if (configured == 1) if (configured == 1)
......
...@@ -633,7 +633,8 @@ void tty_port_close(struct tty_port *port, struct tty_struct *tty, ...@@ -633,7 +633,8 @@ void tty_port_close(struct tty_port *port, struct tty_struct *tty,
if (tty_port_close_start(port, tty, filp) == 0) if (tty_port_close_start(port, tty, filp) == 0)
return; return;
tty_port_shutdown(port, tty); tty_port_shutdown(port, tty);
set_bit(TTY_IO_ERROR, &tty->flags); if (!port->console)
set_bit(TTY_IO_ERROR, &tty->flags);
tty_port_close_end(port, tty); tty_port_close_end(port, tty);
tty_port_tty_set(port, NULL); tty_port_tty_set(port, NULL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment