]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Fix null pointer on analog detection
authorHarry Wentland <harry.wentland@amd.com>
Wed, 29 Oct 2025 14:28:14 +0000 (10:28 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 4 Nov 2025 16:52:46 +0000 (11:52 -0500)
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: 70181ad96ec2 ("drm/amd/display: Add common modes to analog displays without EDID")
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index bb0fe91a160101aac62318617711cbb7083cce1a..b798154768c85e0eb351df5d9b19985ae15de439 100644 (file)
@@ -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.
                         */