usb: misc: usbtest: add fix for driver hang
authorLu Baolu <baolu.lu@linux.intel.com>
Thu, 11 Aug 2016 02:31:14 +0000 (10:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Sep 2016 06:32:38 +0000 (08:32 +0200)
commit97b23f9de12f36cd8f50201f4572bf80cdc6becf
tree8fcbbf1e2f4d42e60f9c4a1c5143d4e21edb722a
parentcb68ec1ce547aef16a9f257ce025b2489c59f227
usb: misc: usbtest: add fix for driver hang

commit 539587511835ea12d8daa444cbed766cf2bc3612 upstream.

In sg_timeout(), req->status is set to "-ETIMEDOUT" before calling
into usb_sg_cancel(). usb_sg_cancel() will do nothing and return
directly if req->status has been set to a non-zero value. This will
cause driver hang whenever transfer time out is triggered.

This patch fixes this issue. It could be backported to stable kernel
with version later than v3.15.

Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/usbtest.c