ttm: Fix uninitialized buffer object sizes.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
This commit is contained in:
Thomas Hellstrom 2009-04-28 20:56:43 +02:00
parent 033d3a9f95
commit 871a640475
2 changed files with 9 additions and 1 deletions

View file

@ -1384,6 +1384,14 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,
printk(KERN_ERR "Could not register buffer object swapout.\n");
goto out_err2;
}
bdev->ttm_bo_extra_size =
ttm_round_pot(sizeof(struct ttm_tt)) +
ttm_round_pot(sizeof(struct ttm_backend));
bdev->ttm_bo_size = bdev->ttm_bo_extra_size +
ttm_round_pot(sizeof(struct ttm_buffer_object));
return 0;
out_err2:
ttm_bo_clean_mm(bdev, 0);

View file

@ -51,7 +51,7 @@ static size_t ttm_pl_size(struct ttm_bo_device *bdev, unsigned long num_pages)
ttm_round_pot(sizeof(struct ttm_bo_user_object));
}
return bdev->ttm_bo_size + 2 * page_array_size;
return pl_bo_size + 2 * page_array_size;
}
static struct ttm_bo_user_object *ttm_bo_user_lookup(struct ttm_object_file