Skip to content

Commit

Permalink
atm: eni: Add check for dma_map_single
Browse files Browse the repository at this point in the history
[ Upstream commit 0f74b29 ]

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

Fixes: 1da177e ("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>
  • Loading branch information
Jiasheng Jiang authored and Greg Kroah-Hartman committed Mar 23, 2022
1 parent b9d5772 commit c66fcd4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/atm/eni.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,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;
Expand Down

0 comments on commit c66fcd4

Please sign in to comment.