Clear error code after intentionally ignoring it

In the case of handling a stall on a max lun request, we need to clear the error code in `ret` after ignoring it. This is necessary so the connect function won't fail.

Fix #339
This commit is contained in:
Derek Konigsberg
2025-07-18 17:55:47 -07:00
committed by sakumisu
parent cc3e91e8d7
commit 7c38af1b04

View File

@@ -284,6 +284,7 @@ static int usbh_msc_connect(struct usbh_hubport *hport, uint8_t intf)
if (ret == -USB_ERR_STALL) { if (ret == -USB_ERR_STALL) {
USB_LOG_WRN("Device does not support multiple LUNs\r\n"); USB_LOG_WRN("Device does not support multiple LUNs\r\n");
g_msc_buf[msc_class->sdchar - 'a'][0] = 0; g_msc_buf[msc_class->sdchar - 'a'][0] = 0;
ret = 0;
} else { } else {
return ret; return ret;
} }