Commit 840d5144 authored by monk.liu's avatar monk.liu Committed by Alex Deucher

drm/amdgpu: fix bug occurs when bo_list is NULL

Still need to handle ibs BO and validate them even bo_list is NULL
Signed-off-by: default avatarMonk.Liu <monk.liu@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7ab7e8a4
...@@ -353,12 +353,10 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p) ...@@ -353,12 +353,10 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p)
{ {
struct amdgpu_fpriv *fpriv = p->filp->driver_priv; struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
struct amdgpu_cs_buckets buckets; struct amdgpu_cs_buckets buckets;
bool need_mmap_lock; bool need_mmap_lock = false;
int i, r; int i, r;
if (p->bo_list == NULL) if (p->bo_list) {
return 0;
need_mmap_lock = p->bo_list->has_userptr; need_mmap_lock = p->bo_list->has_userptr;
amdgpu_cs_buckets_init(&buckets); amdgpu_cs_buckets_init(&buckets);
for (i = 0; i < p->bo_list->num_entries; i++) for (i = 0; i < p->bo_list->num_entries; i++)
...@@ -366,6 +364,8 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p) ...@@ -366,6 +364,8 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p)
p->bo_list->array[i].priority); p->bo_list->array[i].priority);
amdgpu_cs_buckets_get_list(&buckets, &p->validated); amdgpu_cs_buckets_get_list(&buckets, &p->validated);
}
p->vm_bos = amdgpu_vm_get_bos(p->adev, &fpriv->vm, p->vm_bos = amdgpu_vm_get_bos(p->adev, &fpriv->vm,
&p->validated); &p->validated);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment