tty: serial: msm_serial.c: Cleaning up uninitialized variables
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Sun, 1 Jun 2014 13:38:24 +0000 (15:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2014 00:38:21 +0000 (17:38 -0700)
There is a risk that the variable will be used without being initialized.

This was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/msm_serial.c

index 72000a6..90feee1 100644 (file)
@@ -917,7 +917,7 @@ static int __init msm_console_setup(struct console *co, char *options)
 {
        struct uart_port *port;
        struct msm_port *msm_port;
-       int baud, flow, bits, parity;
+       int baud = 0, flow, bits, parity;
 
        if (unlikely(co->index >= UART_NR || co->index < 0))
                return -ENXIO;