Skip to content

Commit

Permalink
drm/radeon: only allocate necessary size for vm bo list
Browse files Browse the repository at this point in the history
No need to always allocate the theoretical maximum here.

Signed-off-by: Christian König <christian.koenig@amd.com>
  • Loading branch information
Christian König committed May 30, 2014
1 parent ec65da3 commit 7d95f6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/radeon/radeon_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ struct radeon_cs_reloc *radeon_vm_get_bos(struct radeon_device *rdev,
struct list_head *head)
{
struct radeon_cs_reloc *list;
unsigned i, idx, size;
unsigned i, idx;

size = (radeon_vm_num_pdes(rdev) + 1) * sizeof(struct radeon_cs_reloc);
list = kmalloc(size, GFP_KERNEL);
list = kmalloc_array(vm->max_pde_used + 1,
sizeof(struct radeon_cs_reloc), GFP_KERNEL);
if (!list)
return NULL;

Expand Down

0 comments on commit 7d95f6c

Please sign in to comment.