diff options
author | Roland Dreier <rolandd@cisco.com> | 2006-10-10 21:50:38 +0200 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-10-10 21:50:38 +0200 |
commit | 73fbe8be73512b8a3ffa3d20c9d7f531af99679c (patch) | |
tree | 71ae6cff83523e337d35f5ad294bc315f603c213 /drivers/infiniband | |
parent | RDMA/amso1100: Fix build with debugging off (diff) | |
download | linux-73fbe8be73512b8a3ffa3d20c9d7f531af99679c.tar.xz 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')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 5 |
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), |