Skip to content

Commit

Permalink
IPoIB: Check for DMA mapping error for TX packets
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Oct 10, 2006
1 parent 1031bfb commit 73fbe8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/infiniband/ulp/ipoib/ipoib_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
tx_req->skb = skb;
addr = dma_map_single(priv->ca->dma_device, skb->data, skb->len,
DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(addr))) {
++priv->stats.tx_errors;
dev_kfree_skb_any(skb);
return;
}
pci_unmap_addr_set(tx_req, mapping, addr);

if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1),
Expand Down

0 comments on commit 73fbe8b

Please sign in to comment.