Skip to content

Commit

Permalink
uas: Streams are numbered 1-y, rather then 0-x
Browse files Browse the repository at this point in the history
It is easier to simply make the arrays one larger, rather then
substracting one everywhere.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
  • Loading branch information
jwrdegoede authored and kraxel committed Nov 26, 2013
1 parent 5eb6d9e commit 0478661
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hw/usb/dev-uas.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0478661

Please sign in to comment.