[PATCH 08/27] drm/amd/display: Check NULL connector before it is used
Wayne Lin
Wayne.Lin at amd.com
Tue Feb 25 06:35:51 UTC 2025
From: Alex Hung <alex.hung at amd.com>
[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 <roman.li at amd.com>
Signed-off-by: Alex Hung <alex.hung at amd.com>
Signed-off-by: Wayne Lin <wayne.lin at amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 3 +++
1 file changed, 3 insertions(+)
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 0d14a0d5def3..5c956b9962dc 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
@@ -1631,6 +1631,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);
--
2.37.3
More information about the amd-gfx
mailing list