提交 73fbe8be 编写于 作者: R Roland Dreier

IPoIB: Check for DMA mapping error for TX packets

Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 1031bfb9
......@@ -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),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册