Skip to contentSkip to conversation

drm/amdgpu: validate the bo from done list for NULL

PATCH In review Sunil Khatri 2 participants 2 messages Oct 31, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: validate the bo from done list for NULL

Make sure the bo is valid before using it.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +2 -0
index cc2f96ed7004..a7ba9994d250 100644
@@ -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
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Sunil Khatri

Make sure the bo is valid before using it.

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
index cc2f96ed7004..a7ba9994d250 100644
@@ -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;