Searched hist:d0009a32c9e4e083358092f3c97e3c6e803a8930 (Results 1 – 1 of 1) sorted by relevance
/linux/drivers/tty/serial/ |
H A D | serial_core.c | diff d0009a32c9e4e083358092f3c97e3c6e803a8930 Mon Aug 05 12:20:36 CEST 2024 Jiri Slaby (SUSE) <jirislaby@kernel.org> serial: don't use uninitialized value in uart_poll_init()
Coverity reports (as CID 1536978) that uart_poll_init() passes uninitialized pm_state to uart_change_pm(). It is in case the first 'if' takes the true branch (does "goto out;").
Fix this and simplify the function by simple guard(mutex). The code needs no labels after this at all. And it is pretty clear that the code has not fiddled with pm_state at that point.
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Fixes: 5e227ef2aa38 (serial: uart_poll_init() should power on the UART) Cc: stable@vger.kernel.org Cc: Douglas Anderson <dianders@chromium.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20240805102046.307511-4-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|