drm/ttm: test for dma_address array allocation failure
authorJerome Glisse <jglisse@redhat.com>
Tue, 1 Nov 2011 23:07:31 +0000 (19:07 -0400)
committerDave Airlie <airlied@redhat.com>
Tue, 6 Dec 2011 10:39:04 +0000 (10:39 +0000)
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
drivers/gpu/drm/ttm/ttm_tt.c

index 90527a2ce04cd47cbc054265c2cde0c084bd04f0..54bbbadba93c9110ec80bfda956607dc60b16398 100644 (file)
@@ -320,7 +320,7 @@ struct ttm_tt *ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size,
        ttm->dummy_read_page = dummy_read_page;
 
        ttm_tt_alloc_page_directory(ttm);
-       if (!ttm->pages) {
+       if (!ttm->pages || !ttm->dma_address) {
                ttm_tt_destroy(ttm);
                printk(KERN_ERR TTM_PFX "Failed allocating page table\n");
                return NULL;