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)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:32:08 +0000 (18:32 +0000)
commit5a41add5d4f27dce607820fa70763cbc36a8bcc1
treee64b4a74e25c893d944842f7eb6ea23dc15996fa
parent4bd00c8eb8bd1ef6855d6be3c689d5d430745492
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: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/garmin_gps.c