[AMD Official Use Only - AMD Internal Distribution Only] Acked-by: Jesse Zhang <[email protected]>
> -----Original Message----- > From: amd-gfx <[email protected]> On Behalf Of Srinivasan > Shanmugam > Sent: Sunday, March 15, 2026 3:13 PM > To: Koenig, Christian <[email protected]>; Deucher, Alexander > <[email protected]> > Cc: [email protected]; SHANMUGAM, SRINIVASAN > <[email protected]>; Zhang, Jesse(Jie) > <[email protected]>; Dan Carpenter <[email protected]> > Subject: [PATCH] drm/amdgpu: Drop redundant queue NULL check in hang detect > worker > > amdgpu_userq_hang_detect_work() retrieves the queue pointer using > container_of() from the embedded work item. > > Since the work structure is part of struct amdgpu_usermode_queue, the returned > queue pointer cannot be NULL in normal execution. > > Remove the redundant !queue check and keep the validation for > queue->userq_mgr. > > Fixes the below: > drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c:159 > amdgpu_userq_hang_detect_work() warn: can 'queue' even be NULL? > > Fixes: 290f46cf5726 ("drm/amdgpu: Implement user queue reset functionality") > Cc: Jesse Zhang <[email protected]> > Cc: Dan Carpenter <[email protected]> > Cc: Christian König <[email protected]> > Cc: Alex Deucher <[email protected]> > Signed-off-by: Srinivasan Shanmugam <[email protected]> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > index cd599b4a9d75..6e0c366f3f00 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > @@ -156,7 +156,7 @@ static void amdgpu_userq_hang_detect_work(struct > work_struct *work) > struct dma_fence *fence; > struct amdgpu_userq_mgr *uq_mgr; > > - if (!queue || !queue->userq_mgr) > + if (!queue->userq_mgr) > return; > > uq_mgr = queue->userq_mgr; > -- > 2.34.1
