diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2022-03-14 04:34:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-03-23 11:13:27 +0300 |
commit | 09a7264fb0d020c2ba38f283d17221cb2c31a5ab (patch) | |
tree | 3bc4c7aa545b50f0b385f554ad45a16aabc1506c /drivers/atm | |
parent | 70b7b3c055fd4a464da8da55ff4c1f84269f9b02 (diff) | |
download | linux-09a7264fb0d020c2ba38f283d17221cb2c31a5ab.tar.xz |
atm: eni: Add check for dma_map_single
[ 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>
Diffstat (limited to 'drivers/atm')
-rw-r--r-- | drivers/atm/eni.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index b574cce98dc3..9fcc49be499f 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c @@ -1112,6 +1112,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags); skb_data3 = skb->data[3]; 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; |