mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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]>
This commit is contained in:
parent
dd01989735
commit
c9bfbb31af
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue