pcmcia: synclink_cs: fix potential tty NULL dereference
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 14 Sep 2012 21:29:37 +0000 (01:29 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2012 20:20:40 +0000 (13:20 -0700)
commit221b7b5796b520b51c34c40239d77921ba39225b
tree18a779b98a3872b086461308e49862a0777a0dcb
parent08b79dd10bb24f5fb12446d21d32c87a8136c770
pcmcia: synclink_cs: fix potential tty NULL dereference

tty_port_tty_get() can return NULL after port hangup that may happen anytime.
The patch adds checks that tty_port_tty_get() returns nonNULL around places
where tty is actually used.

I have no actual hardware to test the patch, so I have updated rx side
processing from common sense only.

v2: rx handling updated according Alan Cox feedback.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/pcmcia/synclink_cs.c