drm/amdgpu: make sure ddc_bus is valid in connector unregister
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 31 Oct 2016 16:27:52 +0000 (12:27 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 31 Oct 2016 16:27:52 +0000 (12:27 -0400)
This should only happen on boards TV connectors which do not
have a ddc bus for those connectors.  None of the asics supported
by amdgpu support tv, so we shouldn't hit this, but check
to be on the safe side (e.g., bios bug for example).

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c

index e3281d4e3e414cc9d693932911215c6fc7216d6f..086aa5c9c6348c45888d0b732f9417c0ec964cbe 100644 (file)
@@ -769,7 +769,7 @@ static void amdgpu_connector_unregister(struct drm_connector *connector)
 {
        struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
 
-       if (amdgpu_connector->ddc_bus->has_aux) {
+       if (amdgpu_connector->ddc_bus && amdgpu_connector->ddc_bus->has_aux) {
                drm_dp_aux_unregister(&amdgpu_connector->ddc_bus->aux);
                amdgpu_connector->ddc_bus->has_aux = false;
        }