Index: chrome/browser/usb/usb_device.cc |
=================================================================== |
--- chrome/browser/usb/usb_device.cc (revision 182069) |
+++ chrome/browser/usb/usb_device.cc (working copy) |
@@ -277,10 +277,8 @@ |
CheckDevice(); |
const uint64 total_length = packets * packet_length; |
- if (total_length > length) { |
- callback.Run(USB_TRANSFER_LENGTH_SHORT, NULL, 0); |
- return; |
- } |
+ CHECK(packets <= length && total_length <= length) << |
+ "transfer length is too small"; |
struct libusb_transfer* const transfer = libusb_alloc_transfer(packets); |
const uint8 new_endpoint = ConvertTransferDirection(direction) | endpoint; |