net: stmmac: Check for DMA mapping errors
authorThierry Reding <treding@nvidia.com>
Fri, 10 Mar 2017 16:34:57 +0000 (17:34 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Mar 2017 06:35:20 +0000 (23:35 -0700)
When DMA mapping an SKB fragment, the mapping must be checked for
errors, otherwise the DMA debug code will complain upon unmap.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index ce6d7e7..eba9088 100644 (file)
@@ -2079,6 +2079,8 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
                des = skb_frag_dma_map(priv->device, frag, 0,
                                       skb_frag_size(frag),
                                       DMA_TO_DEVICE);
+               if (dma_mapping_error(priv->device, des))
+                       goto dma_map_err;
 
                stmmac_tso_allocator(priv, des, skb_frag_size(frag),
                                     (i == nfrags - 1));