summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-10-10 12:50:38 -0700
committerRoland Dreier <rolandd@cisco.com>2006-10-10 12:50:38 -0700
commit73fbe8be73512b8a3ffa3d20c9d7f531af99679c (patch)
tree71ae6cff83523e337d35f5ad294bc315f603c213 /drivers/infiniband/ulp
parent1031bfb93adf641436b2192170525b76e2eb25bd (diff)
downloadblackbird-op-linux-73fbe8be73512b8a3ffa3d20c9d7f531af99679c.tar.gz
blackbird-op-linux-73fbe8be73512b8a3ffa3d20c9d7f531af99679c.zip
IPoIB: Check for DMA mapping error for TX packets
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index f426a69d9a43..8bf5e9ec7c95 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -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),
OpenPOWER on IntegriCloud