From d0d72baa87964a4f76f34949b16a02736ca04bdf Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 21 Jun 2010 17:05:53 +0000 Subject: Fixed bug 3019158. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2028 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chqueues.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'os/kernel/src/chqueues.c') 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)) { -- cgit v1.2.3