Skip to content

Commit 09a7264

Browse files
JiangJiasgregkh
authored andcommitted
atm: eni: Add check for dma_map_single
[ 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>
1 parent 70b7b3c commit 09a7264

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/atm/eni.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags);
11121112
skb_data3 = skb->data[3];
11131113
paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len,
11141114
DMA_TO_DEVICE);
1115+
if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr))
1116+
return enq_next;
11151117
ENI_PRV_PADDR(skb) = paddr;
11161118
/* prepare DMA queue entries */
11171119
j = 0;

0 commit comments

Comments
 (0)