drm/amd/display: Clear dc_sink after it gets released
authorJerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
Thu, 24 Jan 2019 16:46:49 +0000 (11:46 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Feb 2019 18:29:48 +0000 (13:29 -0500)
[Why]
The dc_sink was released but the pointer on the aconnector was
not cleared.

[How]
Clear it.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

index 73f8e8fa6edb2c1622ed197047af61c77d7803ab..44c1a02e6452ebe59d7fd7eca6b4eeabb3639e85 100644 (file)
@@ -173,8 +173,10 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector)
                aconnector->edid = edid;
        }
 
-       if (aconnector->dc_sink && aconnector->dc_sink->sink_signal == SIGNAL_TYPE_VIRTUAL)
+       if (aconnector->dc_sink && aconnector->dc_sink->sink_signal == SIGNAL_TYPE_VIRTUAL) {
                dc_sink_release(aconnector->dc_sink);
+               aconnector->dc_sink = NULL;
+       }
 
        if (!aconnector->dc_sink) {
                struct dc_sink *dc_sink;