When Q_INDEX is increased, the queue->length should be increased,
only when Q_INDEX_DONE is increased should queue_length be descreased.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
        if (queue->index[index] >= queue->limit)
                queue->index[index] = 0;
 
-       queue->length--;
-       queue->count += (index == Q_INDEX_DONE);
+       if (index == Q_INDEX) {
+               queue->length++;
+       } else if (index == Q_INDEX_DONE) {
+               queue->length--;
+               queue->count ++;
+       }
 
        spin_unlock(&queue->lock);
 }