Skip to content

Commit

Permalink
V4L/DVB (9472): dm1105: fix the misuse of pci_dma_mapping_error
Browse files Browse the repository at this point in the history
pci_dma_mapping_error can't be used for pci_alloc_consistent
(pci_dma_mapping_error is for dma_map_single and dma_map_page).
pci_alloc_consistent returns NULL if the allocation fails.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
FUJITA Tomonori authored and Mauro Carvalho Chehab committed Dec 29, 2008
1 parent 20dafb3 commit 7b51a70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/dvb/dm1105/dm1105.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ static int __devinit dm1105dvb_dma_map(struct dm1105dvb *dm1105dvb)
{
dm1105dvb->ts_buf = pci_alloc_consistent(dm1105dvb->pdev, 6*DM1105_DMA_BYTES, &dm1105dvb->dma_addr);

return pci_dma_mapping_error(dm1105dvb->pdev, dm1105dvb->dma_addr);
return !dm1105dvb->ts_buf;
}

static void dm1105dvb_dma_unmap(struct dm1105dvb *dm1105dvb)
Expand Down

0 comments on commit 7b51a70

Please sign in to comment.