diff options
author | Thierry Reding <treding@nvidia.com> | 2017-03-10 17:34:57 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-12 23:35:20 -0700 |
commit | 937071c171ff3656e196c965c5179ba3f9f6a2fc (patch) | |
tree | 01415d9eed3d5a3e99082b0faf2af482880636ed /drivers/net/ethernet | |
parent | 0ad2be79f254965f277fabdd7c64512527208f64 (diff) |
net: stmmac: Check for DMA mapping errors
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ce6d7e791f3f..eba9088e1f61 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -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)); |