summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-03-22 14:16:13 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-03-22 08:21:00 -0700
commite9a079f1f145fd07e45aeab9911764c8b45a0b10 (patch)
tree3e4771ba3dde9dc8af39e716c0f789d873c3db2f
parentf55d659c0804320b82975e4a23bc9fa716d7242e (diff)
downloadchrome-ec-e9a079f1f145fd07e45aeab9911764c8b45a0b10.tar.gz
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>
-rw-r--r--chip/stm32/usb-stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/stm32/usb-stream.c b/chip/stm32/usb-stream.c
index 45c57e6ab1..313e29e8df 100644
--- a/chip/stm32/usb-stream.c
+++ b/chip/stm32/usb-stream.c
@@ -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,