0 is a valid DMA address from pci_map_page(), use pci_dma_mapping_error()
instead to check for errors

Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org>
---
 drivers/gpu/drm/radeon/radeon_device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c 
b/drivers/gpu/drm/radeon/radeon_device.c
index 6c95dcf..83024e8 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -347,7 +347,8 @@ int radeon_dummy_page_init(struct radeon_device *rdev)
                return -ENOMEM;
        rdev->dummy_page.addr = pci_map_page(rdev->pdev, rdev->dummy_page.page,
                                        0, PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
-       if (!rdev->dummy_page.addr) {
+       if (pci_dma_mapping_error(rdev->pdev, rdev->dummy_page.addr)) {
+               dev_err(rdev->pdev, "Failed to DMA MAP the dummy page\n");
                __free_page(rdev->dummy_page.page);
                rdev->dummy_page.page = NULL;
                return -ENOMEM;



------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to