From: Shaoyun Liu Date: Thu, 12 Jul 2018 02:33:00 +0000 (-0400) Subject: drm/amdgpu: Check NULL pointer for job before reset job's ring X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=67ccea60591a0515c885af9bf8dfb932a905457f;p=linux.git drm/amdgpu: Check NULL pointer for job before reset job's ring job could be NULL when amdgpu_device_gpu_recover is called Signed-off-by: Shaoyun Liu Reviewed-by: Andrey Grodzovsky Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index b895584bb99f3..13acef526c5ba 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3325,7 +3325,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, if (job && job->base.sched == &ring->sched) continue; - drm_sched_hw_job_reset(&ring->sched, &job->base); + drm_sched_hw_job_reset(&ring->sched, job ? &job->base : NULL); /* after all hw jobs are reset, hw fence is meaningless, so force_completion */ amdgpu_fence_driver_force_completion(ring);