]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.33/tty-serial-qcom_geni_serial-initialize-baud-in-qcom_geni_console_setup.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.19.33 / tty-serial-qcom_geni_serial-initialize-baud-in-qcom_geni_console_setup.patch
1 From c5cbc78acf693f5605d4a85b1327fa7933daf092 Mon Sep 17 00:00:00 2001
2 From: Nathan Chancellor <natechancellor@gmail.com>
3 Date: Fri, 8 Mar 2019 11:37:44 -0700
4 Subject: tty: serial: qcom_geni_serial: Initialize baud in qcom_geni_console_setup
5
6 From: Nathan Chancellor <natechancellor@gmail.com>
7
8 commit c5cbc78acf693f5605d4a85b1327fa7933daf092 upstream.
9
10 When building with -Wsometimes-uninitialized, Clang warns:
11
12 drivers/tty/serial/qcom_geni_serial.c:1079:6: warning: variable 'baud'
13 is used uninitialized whenever 'if' condition is false
14 [-Wsometimes-uninitialized]
15
16 It's not wrong; when options is NULL, baud has no default value. Use
17 9600 as that is a sane default.
18
19 Link: https://github.com/ClangBuiltLinux/linux/issues/395
20 Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
22 Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
23 Cc: stable <stable@vger.kernel.org>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25
26 ---
27 drivers/tty/serial/qcom_geni_serial.c | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30 --- a/drivers/tty/serial/qcom_geni_serial.c
31 +++ b/drivers/tty/serial/qcom_geni_serial.c
32 @@ -1052,7 +1052,7 @@ static int __init qcom_geni_console_setu
33 {
34 struct uart_port *uport;
35 struct qcom_geni_serial_port *port;
36 - int baud;
37 + int baud = 9600;
38 int bits = 8;
39 int parity = 'n';
40 int flow = 'n';