summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/serial_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 70bf2bec875c..be74d30cfa9e 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -775,6 +775,9 @@ static int uart_get_info(struct tty_port *port, struct serial_struct *retinfo)
struct uart_port *uport;
int ret = -ENODEV;
+ /* Initialize structure in case we error out later to prevent any stack info leakage. */
+ *retinfo = (struct serial_struct){};
+
/*
* Ensure the state we copy is consistent and no hardware changes
* occur as we go