USB: serial: cyberjack: fix write-URB completion race
authorJohan Hovold <johan@kernel.org>
Mon, 26 Oct 2020 08:25:48 +0000 (09:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Nov 2020 09:29:06 +0000 (10:29 +0100)
commit005aa2b4848e666a7849a944f901f14b21647918
tree6394d51b6c9b36c759ab01a225d91b277b06e437
parentbe96acc7c1f6b1810d37382bfc3b57621d79972a
USB: serial: cyberjack: fix write-URB completion race

commit 985616f0457d9f555fff417d0da56174f70cc14f upstream.

The write-URB busy flag was being cleared before the completion handler
was done with the URB, something which could lead to corrupt transfers
due to a racing write request if the URB is resubmitted.

Fixes: 507ca9bc0476 ("[PATCH] USB: add ability for usb-serial drivers to determine if their write urb is currently being used.")
Cc: stable <stable@vger.kernel.org> # 2.6.13
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/cyberjack.c