libpayload: usbmsc: update return value of CSW transfer

When the first CSW transfer failed, get_csw function will retry
CSW transfer again, but the return value is not updated.

Change-Id: I289916baa08d0a189d659164a0002347f6f435db
Signed-off-by: Changqi Hu <changqi.hu@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36678
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Changqi Hu 2019-11-08 18:24:17 +08:00 committed by Patrick Georgi
parent 1b95501fad
commit bc2f9a30f3
1 changed files with 2 additions and 2 deletions

4
payloads/libpayload/drivers/usb/usbmsc.c Normal file → Executable file
View File

@ -232,10 +232,10 @@ get_csw (endpoint_t *ep, csw_t *csw)
if (ret < 0) {
clear_stall (ep);
if (ctrlr->bulk (ep, sizeof (csw_t), (u8 *) csw, 1) < 0) {
ret = ctrlr->bulk (ep, sizeof (csw_t), (u8 *) csw, 1);
if (ret < 0)
return reset_transport (ep->dev);
}
}
if (ret != sizeof(csw_t) || csw->dCSWTag != tag ||
csw->dCSWSignature != csw_signature) {
usb_debug ("MSC: received malformed CSW\n");