chip/stm32/usb-stream: Fix rx_read queue space comparison

There is no reason to reject the incoming USB packet if its
size equals the amount of space in the queue.

BRANCH=none
BUG=b:35587171
TEST=usb_updater2 works fine, even with 64-byte USB packets.

Change-Id: I2e54f1a758dd8a370dacdc8c2519bbd91e9cb4e5
Reviewed-on: https://chromium-review.googlesource.com/458042
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Nicolas Boichat
2017-03-22 14:16:13 +08:00
committed by chrome-bot
parent f55d659c08
commit e9a079f1f1

View File

@@ -24,7 +24,7 @@ static size_t rx_read(struct usb_stream_config const *config)
* Only read the received USB packet if there is enough space in the
* receive queue.
*/
if (count >= queue_space(config->producer.queue))
if (count > queue_space(config->producer.queue))
return 0;
return queue_add_memcpy(config->producer.queue,