]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: serial: quatech2: handle unbound ports
authorJohan Hovold <johan@kernel.org>
Fri, 17 Jan 2020 14:35:26 +0000 (15:35 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:03:32 +0000 (19:03 +0100)
commit56cda5ce62bc98d32bf2a36f93efbdb2a44ffcca
tree90e75b71492df9259c5983555bcaf0ab37a91ce8
parent30039fa5d5176a600581e996f5ef574a2bb54ecf
USB: serial: quatech2: handle unbound ports

commit 9715a43eea77e42678a1002623f2d9a78f5b81a1 upstream.

Check for NULL port data in the modem- and line-status handlers to avoid
dereferencing a NULL pointer in the unlikely case where a port device
isn't bound to a driver (e.g. after an allocation failure on port
probe).

Note that the other (stubbed) event handlers qt2_process_xmit_empty()
and qt2_process_flush() would need similar sanity checks in case they
are ever implemented.

Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/quatech2.c