drm/amdgpu: fix mutex list null pointer reference
authorPixel Ding <Pixel.Ding@amd.com>
Tue, 25 Apr 2017 08:47:42 +0000 (16:47 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 May 2017 22:15:21 +0000 (18:15 -0400)
Fix NULL pointer reference.

Signed-off-by: Pixel Ding <Pixel.Ding@amd.com>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 367811cd0763113798f30f637e834b07d9012c27..43ca16b6eee28e44e92944eaa8e398f4ccbc825e 100644 (file)
@@ -2065,7 +2065,8 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
 
        DRM_INFO("amdgpu: finishing device.\n");
        adev->shutdown = true;
-       drm_crtc_force_disable_all(adev->ddev);
+       if (adev->mode_info.mode_config_initialized)
+               drm_crtc_force_disable_all(adev->ddev);
        /* evict vram memory */
        amdgpu_bo_evict_vram(adev);
        amdgpu_ib_pool_fini(adev);