From: Alex Hung Date: Wed, 19 Feb 2025 04:14:47 +0000 (-0700) Subject: drm/amd/display: Check NULL connector before it is used X-Git-Tag: v6.15-rc1~120^2~12^2~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02b2c97824df69f5a8618b28fcb7060be6166436;p=thirdparty%2Flinux.git drm/amd/display: Check NULL connector before it is used [Why & How] amdgpu_dm_find_first_crtc_matching_connector can return NULL. It is necessary to the returned connector before passing it drm_atomic_get_new_connector_state which always assumes connector is not NULL. Reviewed-by: Roman Li Signed-off-by: Alex Hung Signed-off-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 056b171989565..7ceedf626d23f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -1632,6 +1632,9 @@ int pre_validate_dsc(struct drm_atomic_state *state, connector = amdgpu_dm_find_first_crtc_matching_connector(state, state->crtcs[ind].ptr); + if (!connector) + continue; + drm_new_conn_state = drm_atomic_get_new_connector_state(state, connector);