]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
drm/amd/display: fix dereference of pointer aconnector when it is null
[linux.git] / drivers / gpu / drm / amd / display / amdgpu_dm / amdgpu_dm_helpers.c
index 4882b47e85ef9978188f5b3598e330900c50e933..57a226c0bc4aba762441dff134df37f740eb3118 100644 (file)
@@ -193,12 +193,11 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
         * that blocks before commit guaranteeing that the state
         * is not gonna be swapped while still in use in commit tail */
 
-       dm_conn_state = to_dm_connector_state(aconnector->base.state);
-
-
        if (!aconnector || !aconnector->mst_port)
                return false;
 
+       dm_conn_state = to_dm_connector_state(aconnector->base.state);
+
        mst_mgr = &aconnector->mst_port->mst_mgr;
 
        if (!mst_mgr->mst_state)