Skip to content

Commit c9bfbb3

Browse files
nhormandavem330
authored andcommitted
tulip: Properly check dma mapping result
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 <[email protected]> CC: Grant Grundler <[email protected]> CC: "David S. Miller" <[email protected]> Reviewed-by: Grant Grundler <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dd01989 commit c9bfbb3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/dec/tulip/interrupt.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ int tulip_refill_rx(struct net_device *dev)
7676

7777
mapping = pci_map_single(tp->pdev, skb->data, PKT_BUF_SZ,
7878
PCI_DMA_FROMDEVICE);
79+
if (dma_mapping_error(&tp->pdev->dev, mapping)) {
80+
dev_kfree_skb(skb);
81+
tp->rx_buffers[entry].skb = NULL;
82+
break;
83+
}
84+
7985
tp->rx_buffers[entry].mapping = mapping;
8086

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

0 commit comments

Comments
 (0)