lkml.org 
[lkml]   [2022]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 06/17] atm: eni: Add check for dma_map_single
    Date
    From: Jiasheng Jiang <jiasheng@iscas.ac.cn>

    [ Upstream commit 0f74b29a4f53627376cf5a5fb7b0b3fa748a0b2b ]

    As the potential failure of the dma_map_single(),
    it should be better to check it and return error
    if fails.

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/atm/eni.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
    index de52428b8833..4816db0553ef 100644
    --- a/drivers/atm/eni.c
    +++ b/drivers/atm/eni.c
    @@ -1116,6 +1116,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags);
    }
    paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len,
    DMA_TO_DEVICE);
    + if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr))
    + return enq_next;
    ENI_PRV_PADDR(skb) = paddr;
    /* prepare DMA queue entries */
    j = 0;
    --
    2.34.1


    \
     
     \ /
      Last update: 2022-03-21 15:05    [W:3.852 / U:0.160 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site