diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-02-13 01:38:34 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-13 01:38:34 +0100 |
commit | 79d2b29e8ab2bd460b07ff783d679d6cd3032769 (patch) | |
tree | 1636e6b53a7fcc3a989fb73dcc2e5bbb6d92adec | |
parent | qlge: bugfix: Fix RX scaling values. (diff) | |
download | linux-79d2b29e8ab2bd460b07ff783d679d6cd3032769.tar.xz linux-79d2b29e8ab2bd460b07ff783d679d6cd3032769.zip |
qlge: bugfix: Add missing rx buf clean index on early exit.
The large receive buffer queue is not properly tracking the current
index in the case where an early exit occurs. This can happen when a
page alloc or dma mapping fails. If this occurs the queue will get
out of sync and invalid indexes can be written to the hardware.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 3ab03695aaf0..8ea72dc60f79 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c @@ -898,6 +898,7 @@ static void ql_update_lbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) lbq_desc->index); lbq_desc->p.lbq_page = alloc_page(GFP_ATOMIC); if (lbq_desc->p.lbq_page == NULL) { + rx_ring->lbq_clean_idx = clean_idx; QPRINTK(qdev, RX_STATUS, ERR, "Couldn't get a page.\n"); return; @@ -907,6 +908,7 @@ static void ql_update_lbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) 0, PAGE_SIZE, PCI_DMA_FROMDEVICE); if (pci_dma_mapping_error(qdev->pdev, map)) { + rx_ring->lbq_clean_idx = clean_idx; put_page(lbq_desc->p.lbq_page); lbq_desc->p.lbq_page = NULL; QPRINTK(qdev, RX_STATUS, ERR, |