summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-05-20 18:05:45 +0700
committerhathach <[email protected]>2024-05-20 18:05:45 +0700
commit3b144be37fc3e146e68f4182bf18a1b460afeba6 (patch)
tree36433a1b25c1846050c783f4e2f85f615adb29e7 /examples/device
parent07d879378f052386699aba1eb41f04d4d32fb865 (diff)
try fixing codeql
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/msc_dual_lun/src/msc_disk_dual.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/device/msc_dual_lun/src/msc_disk_dual.c b/examples/device/msc_dual_lun/src/msc_disk_dual.c
index 81f1d3346..b44b77c6c 100644
--- a/examples/device/msc_dual_lun/src/msc_disk_dual.c
+++ b/examples/device/msc_dual_lun/src/msc_disk_dual.c
@@ -300,10 +300,8 @@ int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t*
// Callback invoked when received an SCSI command not in built-in list below
// - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE
-// - READ10 and WRITE10 has their own callbacks
+// - READ10 and WRITE10 has their own callbacks (MUST not be handled here)
int32_t tud_msc_scsi_cb(uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize) {
- // read10 & write10 has their own callback and MUST not be handled here
-
void const* response = NULL;
int32_t resplen = 0;
@@ -316,8 +314,7 @@ int32_t tud_msc_scsi_cb(uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, u
tud_msc_set_sense(lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00);
// negative means error -> tinyusb could stall and/or response with failed status
- resplen = -1;
- break;
+ return -1;
}
// return resplen must not larger than bufsize