summaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-09-13 12:26:51 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-24 06:42:12 +0200
commitfac1f48584c1b6c745412cf8c5dbdc1725aad8f2 (patch)
tree032643f3550c9ac6b5142ee2a52bcb0a962487a1 /drivers/usb/storage
parentuas: Log error codes when logging errors (diff)
downloadlinux-fac1f48584c1b6c745412cf8c5dbdc1725aad8f2.tar.xz
linux-fac1f48584c1b6c745412cf8c5dbdc1725aad8f2.zip
uas: Add response iu handling
If something goes wrong in our communication with an uas device we may get a response iu in reaction to a cmnd, rather then a status iu. In this case propagate an error upwards, rather then logging a bogus iu message. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r--drivers/usb/storage/uas.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index dfa11912708d..b27fe21d866d 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -328,6 +328,16 @@ static void uas_stat_cmplt(struct urb *urb)
}
uas_xfer_data(urb, cmnd, SUBMIT_DATA_OUT_URB);
break;
+ case IU_ID_RESPONSE:
+ uas_log_cmd_state(cmnd, "unexpected response iu",
+ ((struct response_iu *)iu)->response_code);
+ /* Error, cancel data transfers */
+ data_in_urb = usb_get_urb(cmdinfo->data_in_urb);
+ data_out_urb = usb_get_urb(cmdinfo->data_out_urb);
+ cmdinfo->state &= ~COMMAND_INFLIGHT;
+ cmnd->result = DID_ERROR << 16;
+ uas_try_complete(cmnd, __func__);
+ break;
default:
uas_log_cmd_state(cmnd, "bogus IU", iu->iu_id);
}