aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-02-24 07:08:44 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-02-24 07:08:44 +0000
commitc41614ea66196b2e05b57a24064be449aa8a8830 (patch)
tree4b50ed25878865da3b03300eaeea9b328b1f9022 /os/hal/src
parent4256a9113fd16e1b8d7cef963f83931b7d9182ad (diff)
downloadChibiOS-c41614ea66196b2e05b57a24064be449aa8a8830.tar.gz
ChibiOS-c41614ea66196b2e05b57a24064be449aa8a8830.tar.bz2
ChibiOS-c41614ea66196b2e05b57a24064be449aa8a8830.zip
Fixed bug 3605793.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5304 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/serial_usb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c
index 23a323356..000d13951 100644
--- a/os/hal/src/serial_usb.c
+++ b/os/hal/src/serial_usb.c
@@ -323,8 +323,9 @@ void sduDataTransmitted(USBDriver *usbp, usbep_t ep) {
chSysLockFromIsr();
usbStartTransmitI(usbp, ep);
}
- else if (!(usbp->epc[ep]->in_state->txsize &
- (usbp->epc[ep]->in_maxsize - 1))) {
+ else if ((usbp->epc[ep]->in_state->txsize > 0) &&
+ !(usbp->epc[ep]->in_state->txsize &
+ (usbp->epc[ep]->in_maxsize - 1))) {
/* Transmit zero sized packet in case the last one has maximum allowed
size. Otherwise the recipient may expect more data coming soon and
not return buffered data to app. See section 5.8.3 Bulk Transfer