Skip to content

Commit

Permalink
tulip: Properly check dma mapping result
Browse files Browse the repository at this point in the history
Tulip throws an error when dma debugging is enabled, as it doesn't properly
check dma mapping results with dma_mapping_error() durring tx ring refills.

Easy fix, just add it in, and drop the frame if the mapping is bad

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Grant Grundler <grundler@parisc-linux.org>
CC: "David S. Miller" <davem@davemloft.net>
Reviewed-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Neil Horman authored and David S. Miller committed Jun 14, 2013
1 parent dd01989 commit c9bfbb3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/ethernet/dec/tulip/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ int tulip_refill_rx(struct net_device *dev)

mapping = pci_map_single(tp->pdev, skb->data, PKT_BUF_SZ,
PCI_DMA_FROMDEVICE);
if (dma_mapping_error(&tp->pdev->dev, mapping)) {
dev_kfree_skb(skb);
tp->rx_buffers[entry].skb = NULL;
break;
}

tp->rx_buffers[entry].mapping = mapping;

tp->rx_ring[entry].buffer1 = cpu_to_le32(mapping);
Expand Down

0 comments on commit c9bfbb3

Please sign in to comment.