diff options
Diffstat (limited to 'firmware/usbstack/usb_storage.c')
-rw-r--r-- | firmware/usbstack/usb_storage.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index c51b0faa4c..b898978776 100644 --- a/firmware/usbstack/usb_storage.c +++ b/firmware/usbstack/usb_storage.c | |||
@@ -816,7 +816,7 @@ static void handle_scsi(struct command_block_wrapper* cbw) | |||
816 | 816 | ||
817 | case SCSI_REPORT_LUNS: { | 817 | case SCSI_REPORT_LUNS: { |
818 | logf("scsi report luns %d",lun); | 818 | logf("scsi report luns %d",lun); |
819 | int allocation_length=0; | 819 | unsigned int allocation_length=0; |
820 | int i; | 820 | int i; |
821 | unsigned int response_length = 8+8*storage_num_drives(); | 821 | unsigned int response_length = 8+8*storage_num_drives(); |
822 | allocation_length|=(cbw->command_block[6]<<24); | 822 | allocation_length|=(cbw->command_block[6]<<24); |
@@ -834,6 +834,7 @@ static void handle_scsi(struct command_block_wrapper* cbw) | |||
834 | #endif | 834 | #endif |
835 | tb.lun_data->luns[i][1]=0; | 835 | tb.lun_data->luns[i][1]=0; |
836 | } | 836 | } |
837 | length = MIN(length, allocation_length); | ||
837 | send_command_result(tb.lun_data, | 838 | send_command_result(tb.lun_data, |
838 | MIN(response_length, length)); | 839 | MIN(response_length, length)); |
839 | break; | 840 | break; |