diff options
author | Steve Lin <stlin@nvidia.com> | 2012-07-19 12:36:18 -0700 |
---|---|---|
committer | Lokesh Pathak <lpathak@nvidia.com> | 2012-07-26 07:41:00 -0700 |
commit | ab5db3d4930f10bf26e5c2d9ca567a447b433e41 (patch) | |
tree | 7a172faf0ec0e1a1376ea3d2e6c52a2a5a1646e5 /drivers/usb | |
parent | da47078147f8080a3f71d7647eb391980924d5dd (diff) |
usb: cdc-acm: fix packet loss issue
There is race between acm_suspend and acm_read_bulk_callback. Host may
receive bulk transfer right before suspend. The packet will be discarded
if this urb is killed in acm_suspend. This patch checks the actual length
of urb and processes it in this case.
Bug 996268
Signed-off-by: Steve Lin <stlin@nvidia.com>
Change-Id: Ief2b42708160b67903f976ec60da825d46c4720b
Reviewed-on: http://git-master/r/117135
(cherry picked from commit af3e96c987fbae8a135d1ff18872b9c32e09b67f)
Reviewed-on: http://git-master/r/118105
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Steve Lin <stlin@nvidia.com>
Reviewed-by: Steve Lin <stlin@nvidia.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 8fb105e03658..cd16e13f61c9 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -416,7 +416,7 @@ static void acm_read_bulk_callback(struct urb *urb) } usb_mark_last_busy(acm->dev); - if (urb->status) { + if (urb->status && !urb->actual_length) { dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n", __func__, urb->status); return; |