Skip to content

Commit eb236fb

Browse files
Alex Hungalexdeucher
authored andcommitted
drm/amd/display: Check NULL before calling dac_load_detection
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 1791761)
1 parent 0de604d commit eb236fb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ static bool link_detect_dac_load_detect(struct dc_link *link)
932932
struct link_encoder *link_enc = link->link_enc;
933933
enum engine_id engine_id = link_enc->preferred_engine;
934934
enum dal_device_type device_type = DEVICE_TYPE_CRT;
935-
enum bp_result bp_result;
935+
enum bp_result bp_result = BP_RESULT_UNSUPPORTED;
936936
uint32_t enum_id;
937937

938938
switch (engine_id) {
@@ -946,7 +946,9 @@ static bool link_detect_dac_load_detect(struct dc_link *link)
946946
break;
947947
}
948948

949-
bp_result = bios->funcs->dac_load_detection(bios, engine_id, device_type, enum_id);
949+
if (bios->funcs->dac_load_detection)
950+
bp_result = bios->funcs->dac_load_detection(bios, engine_id, device_type, enum_id);
951+
950952
return bp_result == BP_RESULT_OK;
951953
}
952954

0 commit comments

Comments
 (0)