qlge: bugfix: Add missing pci_mapping_err checking.
authorRon Mercer <ron.mercer@qlogic.com>
Mon, 5 Jan 2009 01:06:46 +0000 (17:06 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Jan 2009 01:06:46 +0000 (17:06 -0800)
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlge/qlge_main.c

index 718a7bd0cd1a207f90a6aaf92ffe894fd5163d79..c6ab6a493e708c9b95ff435ce8f2a1492a6338cc 100644 (file)
@@ -963,6 +963,11 @@ static void ql_update_sbq(struct ql_adapter *qdev, struct rx_ring *rx_ring)
                                                     sbq_desc->p.skb->data,
                                                     rx_ring->sbq_buf_size /
                                                     2, PCI_DMA_FROMDEVICE);
+                               if (pci_dma_mapping_error(qdev->pdev, map)) {
+                                       QPRINTK(qdev, IFUP, ERR, "PCI mapping failed.\n");
+                                       rx_ring->sbq_clean_idx = clean_idx;
+                                       return;
+                               }
                                pci_unmap_addr_set(sbq_desc, mapaddr, map);
                                pci_unmap_len_set(sbq_desc, maplen,
                                                  rx_ring->sbq_buf_size / 2);