aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/dev-uas.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-10-24 18:15:52 +0100
committerGerd Hoffmann <kraxel@redhat.com>2013-11-26 09:21:17 +0100
commit0478661ec5f949f16a70687b348c0fb2a56cc537 (patch)
tree2ba1db05e3793730990d63c88c84d93c5db353c7 /hw/usb/dev-uas.c
parent5eb6d9e3ef1fac096ab5b3f5c14e1f4079dd7367 (diff)
uas: Streams are numbered 1-y, rather then 0-x
It is easier to simply make the arrays one larger, rather then substracting one everywhere. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/dev-uas.c')
-rw-r--r--hw/usb/dev-uas.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
index 12d79ef743..70f41d390a 100644
--- a/hw/usb/dev-uas.c
+++ b/hw/usb/dev-uas.c
@@ -122,8 +122,8 @@ struct UASDevice {
UASRequest *dataout2;
/* usb 3.0 only */
- USBPacket *data3[UAS_MAX_STREAMS];
- USBPacket *status3[UAS_MAX_STREAMS];
+ USBPacket *data3[UAS_MAX_STREAMS + 1];
+ USBPacket *status3[UAS_MAX_STREAMS + 1];
};
struct UASRequest {
@@ -666,7 +666,7 @@ static void usb_uas_cancel_io(USBDevice *dev, USBPacket *p)
return;
}
if (uas_using_streams(uas)) {
- for (i = 0; i < UAS_MAX_STREAMS; i++) {
+ for (i = 0; i <= UAS_MAX_STREAMS; i++) {
if (uas->status3[i] == p) {
uas->status3[i] = NULL;
return;