diff options
author | Junwei Zhang <Jerry.Zhang@amd.com> | 2018-04-23 05:21:21 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-15 14:43:49 -0400 |
commit | 8239f57ac3e9bf9ad0cf4d396ebfa721e91ac611 (patch) | |
tree | c22812b8f84c2b02ffad161e05d12ab1f025fa93 /drivers/gpu/drm/amd | |
parent | 6c8d74caa2fa33908ecd07fb1cf1b7bc629b367a (diff) |
drm/amdgpu: bo could be null when access in vm bo update
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: David Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 6a372ca11ee3..1c00f1a56e8b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -1509,7 +1509,6 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, | |||
1509 | struct drm_mm_node *nodes; | 1509 | struct drm_mm_node *nodes; |
1510 | struct dma_fence *exclusive, **last_update; | 1510 | struct dma_fence *exclusive, **last_update; |
1511 | uint64_t flags; | 1511 | uint64_t flags; |
1512 | uint32_t mem_type; | ||
1513 | int r; | 1512 | int r; |
1514 | 1513 | ||
1515 | if (clear || !bo_va->base.bo) { | 1514 | if (clear || !bo_va->base.bo) { |
@@ -1568,9 +1567,9 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, | |||
1568 | * the evicted list so that it gets validated again on the | 1567 | * the evicted list so that it gets validated again on the |
1569 | * next command submission. | 1568 | * next command submission. |
1570 | */ | 1569 | */ |
1571 | mem_type = bo->tbo.mem.mem_type; | ||
1572 | if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv && | 1570 | if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv && |
1573 | !(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type))) | 1571 | !(bo->preferred_domains & |
1572 | amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type))) | ||
1574 | list_add_tail(&bo_va->base.vm_status, &vm->evicted); | 1573 | list_add_tail(&bo_va->base.vm_status, &vm->evicted); |
1575 | spin_unlock(&vm->status_lock); | 1574 | spin_unlock(&vm->status_lock); |
1576 | 1575 | ||