From dec32b6f66df644e81cc7fba05f7ed7f6d4316cd Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 24 Oct 2008 09:13:23 +0000 Subject: dm1105: fix the misuse of pci_dma_mapping_error From: FUJITA Tomonori 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. Acked-by: Igor M. Liplianin Signed-off-by: FUJITA Tomonori Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/dm1105/dm1105.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'linux/drivers/media/dvb/dm1105') diff --git a/linux/drivers/media/dvb/dm1105/dm1105.c b/linux/drivers/media/dvb/dm1105/dm1105.c index 19daa752f..f578cbdb6 100644 --- a/linux/drivers/media/dvb/dm1105/dm1105.c +++ b/linux/drivers/media/dvb/dm1105/dm1105.c @@ -367,11 +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); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) - return pci_dma_mapping_error(dm1105dvb->dma_addr); -#else - return pci_dma_mapping_error(dm1105dvb->pdev, dm1105dvb->dma_addr); -#endif + return !dm1105dvb->ts_buf; } static void dm1105dvb_dma_unmap(struct dm1105dvb *dm1105dvb) -- cgit v1.2.3