USB: serial: garmin_gps: fix I/O after failed probe and remove
authorJohan Hovold <johan@kernel.org>
Wed, 11 Oct 2017 12:02:57 +0000 (14:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Nov 2017 09:24:35 +0000 (10:24 +0100)
commit031bd81488143bfdc51d38b88ee85898dfd4c2e6
treeef5fa1cbe480cc26c8d1bee619d90607d761eab0
parent8eb1108ad8fe1efb84644210c67d1c2c2b263c6a
USB: serial: garmin_gps: fix I/O after failed probe and remove

commit 19a565d9af6e0d828bd0d521d3bafd5017f4ce52 upstream.

Make sure to stop any submitted interrupt and bulk-out URBs before
returning after failed probe and when the port is being unbound to avoid
later NULL-pointer dereferences in the completion callbacks.

Also fix up the related and broken I/O cancellation on failed open and
on close. (Note that port->write_urb was never submitted.)

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
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/garmin_gps.c