1 | Index: usb_disk.cpp
|
---|
2 | ===================================================================
|
---|
3 | --- usb_disk.cpp (revision 38606)
|
---|
4 | +++ usb_disk.cpp (working copy)
|
---|
5 | @@ -363,15 +363,10 @@
|
---|
6 | switch (status.status) {
|
---|
7 | case CSW_STATUS_COMMAND_PASSED:
|
---|
8 | case CSW_STATUS_COMMAND_FAILED: {
|
---|
9 | - if (status.data_residue > command.data_transfer_length) {
|
---|
10 | - // command status wrapper is not meaningful
|
---|
11 | - TRACE_ALWAYS("command status wrapper has invalid residue\n");
|
---|
12 | - usb_disk_reset_recovery(device);
|
---|
13 | - return B_ERROR;
|
---|
14 | - }
|
---|
15 | + const uint32 residue = command.data_transfer_length - transferedData;
|
---|
16 |
|
---|
17 | if (dataLength != NULL) {
|
---|
18 | - *dataLength -= status.data_residue;
|
---|
19 | + *dataLength -= residue;
|
---|
20 | if (transferedData < *dataLength) {
|
---|
21 | TRACE_ALWAYS("less data transfered than indicated\n");
|
---|
22 | *dataLength = transferedData;
|
---|