From: Roland Dreier Date: Tue, 10 Oct 2006 19:50:38 +0000 (-0700) Subject: IPoIB: Check for DMA mapping error for TX packets X-Git-Tag: v2.6.19-rc2~198 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=73fbe8be73512b8a3ffa3d20c9d7f531af99679c;p=linux-2.6-omap-h63xx.git IPoIB: Check for DMA mapping error for TX packets Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index f426a69d9a4..8bf5e9ec7c9 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),