• Jiri Slaby's avatar
    tty: serial_core, remove state checks in uart_poll* · 22077b09
    Jiri Slaby authored
    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: default avatarJiri 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    22077b09
serial_core.c 73.7 KB