Commit 5e55fd9b authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher
Browse files

drm/amd/display: Fix null pointer on analog detection



Check if we have an amdgpu_dm_connector->dc_sink first before
adding common modes for analog outputs. If we don't have a
sink yet we can safely skip this.

Fixes: 70181ad9 ("drm/amd/display: Add common modes to analog displays without EDID")
Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
Reviewed-by: default avatarTimur Kristóf <timur.kristof@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 812b7273
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8690,7 +8690,7 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
			amdgpu_dm_connector->num_modes +=
				drm_add_modes_noedid(connector, 1920, 1080);

		if (amdgpu_dm_connector->dc_sink->edid_caps.analog) {
		if (amdgpu_dm_connector->dc_sink && amdgpu_dm_connector->dc_sink->edid_caps.analog) {
			/* Analog monitor connected by DAC load detection.
			 * Add common modes. It will be up to the user to select one that works.
			 */