From: Jiri Slaby serial167, remove useless tty check tty is dereferenced before it is checked to be non-NULL. Remove such check. Signed-off-by: Jiri Slaby Cc: Alan Cox Signed-off-by: Andrew Morton --- drivers/char/serial167.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/char/serial167.c~char-serial167-remove-useless-tty-check drivers/char/serial167.c --- a/drivers/char/serial167.c~char-serial167-remove-useless-tty-check +++ a/drivers/char/serial167.c @@ -1121,7 +1121,7 @@ cy_put_char(struct tty_struct *tty, unsi if (serial_paranoia_check(info, tty->name, "cy_put_char")) return; - if (!tty || !info->xmit_buf) + if (!info->xmit_buf) return; local_irq_save(flags); @@ -1187,7 +1187,7 @@ cy_write(struct tty_struct * tty, return 0; } - if (!tty || !info->xmit_buf){ + if (!info->xmit_buf){ return 0; } _