Skip to content

Commit

Permalink
[SERIAL] remove unneeded code from serial_core.c
Browse files Browse the repository at this point in the history
This patch fixes an issue reported by Coverity in serial/serial_core.c

Error reported: Variable "&((info)->tty)->flags" tracked as NULL was passed to a
function that dereferences it.

The later statements in the function assumes 'info->tty != NULL', so this
check is not necessary.  Probably a 'BUG_ON(info->tty == NULL)' can be added.

Signed-off-by: Jayachandran C. <c.jayachandran at gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Jayachandran C authored and Russell King committed Oct 30, 2005
1 parent 9f75e1e commit a2436b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ static int uart_startup(struct uart_state *state, int init_hw)
* once we have successfully opened the port. Also set
* up the tty->alt_speed kludge
*/
if (info->tty)
set_bit(TTY_IO_ERROR, &info->tty->flags);
set_bit(TTY_IO_ERROR, &info->tty->flags);

if (port->type == PORT_UNKNOWN)
return 0;
Expand Down

0 comments on commit a2436b2

Please sign in to comment.