drm/amd/dc: Fix a missing check bug in dm_dp_mst_detect()
authorYingjie Wang <wangyingjie55@126.com>
Fri, 9 Apr 2021 00:57:20 +0000 (17:57 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 23 Apr 2021 21:19:22 +0000 (17:19 -0400)
In dm_dp_mst_detect(), We should check whether or not @connector
has been unregistered from userspace. If the connector is unregistered,
we should return disconnected status.

Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)")
Signed-off-by: Yingjie Wang <wangyingjie55@126.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

index 9b221db526dc924c11ddf901e001d548e669ea5b..d62460b69d95439e7a899f98b84ffff74dd764a0 100644 (file)
@@ -278,6 +278,9 @@ dm_dp_mst_detect(struct drm_connector *connector,
        struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
        struct amdgpu_dm_connector *master = aconnector->mst_port;
 
+       if (drm_connector_is_unregistered(connector))
+               return connector_status_disconnected;
+
        return drm_dp_mst_detect_port(connector, ctx, &master->mst_mgr,
                                      aconnector->port);
 }