提交 7d95f6cc 编写于 作者: C Christian König

drm/radeon: only allocate necessary size for vm bo list

No need to always allocate the theoretical maximum here.
Signed-off-by: NChristian König <christian.koenig@amd.com>
上级 ec65da38
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册