NFC: nfcmrvl_uart: add missing tty-device sanity check
authorJohan Hovold <johan@kernel.org>
Thu, 30 Mar 2017 10:15:36 +0000 (12:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2017 22:07:56 +0000 (15:07 -0700)
commit7de6ff402dd02cbfc6b963068efd6efecc0e4978
tree52afe449b87bf832f9b4b347d0106a8f98580b0b
parentf73de3f9915c997dd091cadcdbafbdb9835f2cf5
NFC: nfcmrvl_uart: add missing tty-device sanity check

commit 15e0c59f1535926a939d1df66d6edcf997d7c1b9 upstream.

Make sure to check the tty-device pointer before trying to access the
parent device to avoid dereferencing a NULL-pointer when the tty is one
end of a Unix98 pty.

Fixes: e097dc624f78 ("NFC: nfcmrvl: add UART driver")
Cc: Vincent Cuissard <cuissard@marvell.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nfc/nfcmrvl/uart.c