From 7c38af1b04ce1d09cf4577a0f95acb4f273e49ee Mon Sep 17 00:00:00 2001 From: Derek Konigsberg Date: Fri, 18 Jul 2025 17:55:47 -0700 Subject: [PATCH] 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 --- class/msc/usbh_msc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/class/msc/usbh_msc.c b/class/msc/usbh_msc.c index fe91a5bf..12a4f673 100644 --- a/class/msc/usbh_msc.c +++ b/class/msc/usbh_msc.c @@ -284,6 +284,7 @@ static int usbh_msc_connect(struct usbh_hubport *hport, uint8_t intf) if (ret == -USB_ERR_STALL) { USB_LOG_WRN("Device does not support multiple LUNs\r\n"); g_msc_buf[msc_class->sdchar - 'a'][0] = 0; + ret = 0; } else { return ret; }