Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rt2x00: Fix queue index handling

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>

authored by

Ivo van Doorn and committed by
John W. Linville
10b6b801 5957da4c

+6 -2
+6 -2
drivers/net/wireless/rt2x00/rt2x00queue.c
··· 84 84 if (queue->index[index] >= queue->limit) 85 85 queue->index[index] = 0; 86 86 87 - queue->length--; 88 - queue->count += (index == Q_INDEX_DONE); 87 + if (index == Q_INDEX) { 88 + queue->length++; 89 + } else if (index == Q_INDEX_DONE) { 90 + queue->length--; 91 + queue->count ++; 92 + } 89 93 90 94 spin_unlock(&queue->lock); 91 95 }