don't deref nullptr

This commit is contained in:
Matthew Kennedy 2021-02-23 23:29:45 -08:00
parent fbd6f482af
commit 1ebdcca467
1 changed files with 2 additions and 1 deletions

View File

@ -284,7 +284,8 @@ bool msd_request_hook(USBDriver *usbp) {
} else if (usbp->setup[0] == (USB_RTYPE_TYPE_CLASS | USB_RTYPE_RECIPIENT_INTERFACE | USB_RTYPE_DIR_DEV2HOST)
&& usbp->setup[1] == MSD_REQ_GET_MAX_LUN) {
/* Return the maximum supported LUN. */
usbSetupTransfer(usbp, 0, 1, NULL);
static uint8_t zero = 0;
usbSetupTransfer(usbp, &zero, 1, NULL);
return true;
/* OR */
/* Return false to stall to indicate that we don't support LUN */