]> 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>
Mon, 5 Jan 2026 21:59:59 +0000 (16:59 -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>
drivers/gpu/drm/amd/display/dc/link/link_detection.c

index af1b456ac94e6ee01a8c5d167bcd60bfe19881c8..56f27a6d2874c41f2d43bfb55a0b47173ee61030 100644 (file)
@@ -934,7 +934,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) {
@@ -948,7 +948,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;
 }