Home
last modified time | relevance | path

Searched hist:"22077 b091a4720d4336bd806e9c93b2a81fcc38a" (Results 1 – 1 of 1) sorted by relevance

/linux/drivers/tty/serial/
H A Dserial_core.cdiff 22077b091a4720d4336bd806e9c93b2a81fcc38a Wed Mar 15 12:00:23 CET 2017 Jiri Slaby <jslaby@suse.cz> tty: serial_core, remove state checks in uart_poll*

Coverity complains about uart_state checks in polling functions. And it
is indeed correct. We do something like this:
struct uart_state *state = drv->state + line;
if (!state)
return;

Adding 'line' to drv->state would move the potential NULL pointer to
something near NULL and the check is useless. Even if we checked pure
drv->state, nothing guarantees it is not freed and NULLed after the
check. So if the only user of this interface (kgdboc) needs to assure
something, this is neither the correct thing, nor place to do so.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: kgdb-bugreport@lists.sourceforge.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>