[media] solo6x10: add call to pci_dma_mapping_error
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 18 Mar 2013 11:21:33 +0000 (08:21 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 25 Mar 2013 11:47:21 +0000 (08:47 -0300)
Check the result of the dma mapping.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/media/solo6x10/p2m.c

index b3a933906b90673feafc1de01a5ca74d8cd61bf0..a77c8d9ed0bf613064ef8affedbe7d69f6b1061c 100644 (file)
@@ -52,6 +52,8 @@ int solo_p2m_dma(struct solo_dev *solo_dev, int wr,
 
        dma_addr = pci_map_single(solo_dev->pdev, sys_addr, size,
                                  wr ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE);
+       if (pci_dma_mapping_error(solo_dev->pdev, dma_addr))
+               return -ENOMEM;
 
        ret = solo_p2m_dma_t(solo_dev, wr, dma_addr, ext_addr, size,
                             repeat, ext_size);