From a2436b22deac7834e0f87897b207a2dc1407dc40 Mon Sep 17 00:00:00 2001 From: Jayachandran C Date: Sun, 30 Oct 2005 23:26:16 +0000 Subject: [SERIAL] remove unneeded code from serial_core.c 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. Signed-off-by: Andrew Morton Signed-off-by: Russell King --- drivers/serial/serial_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 2d8622eef701..401d94a7fe2e 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -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; -- cgit v1.2.2