]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Check NULL before calling dac_load_detection
authorAlex Hung <alex.hung@amd.com>
Mon, 8 Dec 2025 19:11:43 +0000 (12:11 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 7 Jan 2026 22:24:16 +0000 (17:24 -0500)
dac_load_detection can be NULL in some scenario, so checking it before
calling.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 179176134b535246f0b368b30e8ecad50066f896)

drivers/gpu/drm/amd/display/dc/link/link_detection.c

index 6d31f4967f1a972a9e49ecf4269efb86bb694038..e1940b8e5bc3f45467966dbe730cb13089b75ea8 100644 (file)
@@ -932,7 +932,7 @@ static bool link_detect_dac_load_detect(struct dc_link *link)
        struct link_encoder *link_enc = link->link_enc;
        enum engine_id engine_id = link_enc->preferred_engine;
        enum dal_device_type device_type = DEVICE_TYPE_CRT;
-       enum bp_result bp_result;
+       enum bp_result bp_result = BP_RESULT_UNSUPPORTED;
        uint32_t enum_id;
 
        switch (engine_id) {
@@ -946,7 +946,9 @@ static bool link_detect_dac_load_detect(struct dc_link *link)
                break;
        }
 
-       bp_result = bios->funcs->dac_load_detection(bios, engine_id, device_type, enum_id);
+       if (bios->funcs->dac_load_detection)
+               bp_result = bios->funcs->dac_load_detection(bios, engine_id, device_type, enum_id);
+
        return bp_result == BP_RESULT_OK;
 }