USB: mxuport: fix null deref when used as a console
commit405703342558427c0e97e1178074c7df15047bd4
authorJohan Hovold <johan@kernel.org>
Wed, 18 Feb 2015 04:51:07 +0000 (18 11:51 +0700)
committerSasha Levin <sasha.levin@oracle.com>
Sat, 14 Mar 2015 19:37:23 +0000 (14 15:37 -0400)
treef0dc7e633e2fdcaf7356a72cd2dc165896de8e92
parente7d3ac3545bc976217858eafd54c40ec7b0335c1
USB: mxuport: fix null deref when used as a console

commit db81de767e375743ebb0ad2bcad3326962c2b67e upstream.

Fix null-pointer dereference at probe when the device is used as a
console, in which case the tty argument to open will be NULL.

Fixes: ee467a1f2066 ("USB: serial: add Moxa UPORT 12XX/14XX/16XX
driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/usb/serial/mxuport.c