USB: serial: ch341: handle unbound port at reset_resume
authorJohan Hovold <johan@kernel.org>
Fri, 17 Jan 2020 09:50:22 +0000 (10:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:22:34 +0000 (08:22 +0100)
commit554b03f5ff9c6a9fce4aa71582ae54ebea9b816f
treeb75b70970d56f4d9af359c01938f57cad528aa13
parent01378bedad879932e8105b2a124c93f048a020f6
USB: serial: ch341: handle unbound port at reset_resume

commit 4d5ef53f75c22d28f490bcc5c771fcc610a9afa4 upstream.

Check for NULL port data in reset_resume() to avoid dereferencing a NULL
pointer in case the port device isn't bound to a driver (e.g. after a
failed control request at port probe).

Fixes: 1ded7ea47b88 ("USB: ch341 serial: fix port number changed after resume")
Cc: stable <stable@vger.kernel.org> # 2.6.30
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/ch341.c