From bc2f9a30f3a61e3d02baf7abcc5440407035f354 Mon Sep 17 00:00:00 2001 From: Changqi Hu Date: Fri, 8 Nov 2019 18:24:17 +0800 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/36678 Tested-by: build bot (Jenkins) Reviewed-by: Hung-Te Lin Reviewed-by: Julius Werner --- payloads/libpayload/drivers/usb/usbmsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 payloads/libpayload/drivers/usb/usbmsc.c diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c old mode 100644 new mode 100755 index 2412e99af3..d8b7bcea6e --- a/payloads/libpayload/drivers/usb/usbmsc.c +++ b/payloads/libpayload/drivers/usb/usbmsc.c @@ -232,9 +232,9 @@ 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) { -- cgit v1.2.3