drm/amdgpu: validate the bo from done list for NULL
Subsystems (2)
PATCH 1/1 drm/amdgpu: validate the bo from done list for NULL
Make sure the bo is valid before using it.
Signed-off-by Sunil Khatri <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +2 -0
@@ -942,6 +942,8 @@ amdgpu_userq_vm_validate(struct amdgpu_userq_mgr *uq_mgr)/* Validate User Ptr BOs */ list_for_each_entry (bo_va, &vm->done, base.vm_status) { bo = bo_va->base.bo; +if (!bo) +continue ;if (!amdgpu_ttm_tt_is_userptr (bo->tbo.ttm))continue ;
Signature · 1 line
2.34.1
Quoted 3 lines · Sunil Khatri
Make sure the bo is valid before using it.
Signed-off-by Sunil Khatri <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +2
-0@@ -942,6 +942,8 @@ amdgpu_userq_vm_validate(struct amdgpu_userq_mgr *uq_mgr)/* Validate User Ptr BOs */ list_for_each_entry (bo_va, &vm->done, base.vm_status) { bo = bo_va->base.bo; +if (!bo) +continue ;if (!amdgpu_ttm_tt_is_userptr (bo->tbo.ttm))continue ;