aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src/chqueues.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-06-21 17:05:53 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-06-21 17:05:53 +0000
commitd0d72baa87964a4f76f34949b16a02736ca04bdf (patch)
treefa8f6a07569de9bc908bdb04d13fe4be296cc8c4 /os/kernel/src/chqueues.c
parentfe292af06d48b5d42b0dd8fcb594b5a9c4668144 (diff)
downloadChibiOS-d0d72baa87964a4f76f34949b16a02736ca04bdf.tar.gz
ChibiOS-d0d72baa87964a4f76f34949b16a02736ca04bdf.tar.bz2
ChibiOS-d0d72baa87964a4f76f34949b16a02736ca04bdf.zip
Fixed bug 3019158.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2028 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src/chqueues.c')
-rw-r--r--os/kernel/src/chqueues.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/os/kernel/src/chqueues.c b/os/kernel/src/chqueues.c
index 651b79f4e..84cbbed94 100644
--- a/os/kernel/src/chqueues.c
+++ b/os/kernel/src/chqueues.c
@@ -154,7 +154,8 @@ msg_t chIQGetTimeout(InputQueue *iqp, systime_t time) {
*
* @param[in] iqp pointer to an @p InputQueue structure
* @param[out] bp pointer to the data buffer
- * @param[in] n the maximum amount of data to be transferred
+ * @param[in] n the maximum amount of data to be transferred, the
+ * value 0 is reserved
* @param[in] time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout.
@@ -167,6 +168,8 @@ size_t chIQReadTimeout(InputQueue *iqp, uint8_t *bp,
qnotify_t nfy = iqp->q_notify;
size_t r = 0;
+ chDbgCheck(n > 0, "chIQReadTimeout");
+
chSysLock();
while (TRUE) {
if (chIQIsEmpty(iqp)) {
@@ -304,7 +307,8 @@ msg_t chOQGetI(OutputQueue *oqp) {
*
* @param[in] oqp pointer to an @p OutputQueue structure
* @param[out] bp pointer to the data buffer
- * @param[in] n the maximum amount of data to be transferred
+ * @param[in] n the maximum amount of data to be transferred, the
+ * value 0 is reserved
* @param[in] time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout.
@@ -317,6 +321,8 @@ size_t chOQWriteTimeout(OutputQueue *oqp, const uint8_t *bp,
qnotify_t nfy = oqp->q_notify;
size_t w = 0;
+ chDbgCheck(n > 0, "chOQWriteTimeout");
+
chSysLock();
while (TRUE) {
if (chOQIsFull(oqp)) {