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)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 18 Jun 2017 21:57:59 +0000 (23:57 +0200)
commit15e0c59f1535926a939d1df66d6edcf997d7c1b9
tree32e8706e33c816dbebeb11a3a7bf3163c5db0ef9
parent20777bc57c346b6994f465e0d8261a7fbf213a09
NFC: nfcmrvl_uart: add missing tty-device sanity check

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: stable <stable@vger.kernel.org> # 4.2
Cc: Vincent Cuissard <cuissard@marvell.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/nfcmrvl/uart.c