qeth: buffer count imbalance
authorJan Glauber <jang@linux.vnet.ibm.com>
Wed, 8 Dec 2010 02:58:01 +0000 (02:58 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Dec 2010 22:28:48 +0000 (14:28 -0800)
The used buffers counter is not incremented in case of an error so
the counter can become negative. Increment the used buffers counter
before checking for errors.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core_main.c

index e6b2df0e73f56a4b143365be8302875c600c49bc..b7d9dc0adc62651159944e76daafd5e26013cafc 100644 (file)
@@ -2840,6 +2840,7 @@ static void qeth_flush_buffers(struct qeth_qdio_out_q *queue, int index,
                queue->card->perf_stats.outbound_do_qdio_time +=
                        qeth_get_micros() -
                        queue->card->perf_stats.outbound_do_qdio_start_time;
+       atomic_add(count, &queue->used_buffers);
        if (rc) {
                queue->card->stats.tx_errors += count;
                /* ignore temporary SIGA errors without busy condition */
@@ -2853,7 +2854,6 @@ static void qeth_flush_buffers(struct qeth_qdio_out_q *queue, int index,
                qeth_schedule_recovery(queue->card);
                return;
        }
-       atomic_add(count, &queue->used_buffers);
        if (queue->card->options.performance_stats)
                queue->card->perf_stats.bufs_sent += count;
 }