mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-04 21:42:31 -04:00
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 <roman.li@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user