lkml.org 
[lkml]   [2017]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 3/7] net: stmmac: Check for DMA mapping errors
    From
    Date
    On 23.02.2017 19:24, Thierry Reding wrote:
    > From: Thierry Reding <treding@nvidia.com>
    >
    > 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>
    > ---
    > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++
    > 1 file changed, 2 insertions(+)
    >
    > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    > index 6b7a5ce19589..d7387919bdb6 100644
    > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    > @@ -2072,6 +2072,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;

    If this map fails, we should also unmap the previously mapped fragments
    and the separate mapping made using dma_map_single.

    >
    > stmmac_tso_allocator(priv, des, skb_frag_size(frag),
    > (i == nfrags - 1));
    >

    \
     
     \ /
      Last update: 2017-02-27 11:32    [W:3.189 / U:0.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site