Commit 8092aa3a authored by Alex Hung's avatar Alex Hung Committed by Alex Deucher

drm/amd/display: Add null checker before passing variables

Checks null pointer before passing variables to functions.

This fixes 3 NULL_RETURNS issues reported by Coverity.
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Acked-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 143818fa
...@@ -2875,6 +2875,7 @@ static int dm_suspend(void *handle) ...@@ -2875,6 +2875,7 @@ static int dm_suspend(void *handle)
dm->cached_dc_state = dc_state_create_copy(dm->dc->current_state); dm->cached_dc_state = dc_state_create_copy(dm->dc->current_state);
if (dm->cached_dc_state)
dm_gpureset_toggle_interrupts(adev, dm->cached_dc_state, false); dm_gpureset_toggle_interrupts(adev, dm->cached_dc_state, false);
amdgpu_dm_commit_zero_streams(dm->dc); amdgpu_dm_commit_zero_streams(dm->dc);
...@@ -7102,6 +7103,7 @@ static void create_eml_sink(struct amdgpu_dm_connector *aconnector) ...@@ -7102,6 +7103,7 @@ static void create_eml_sink(struct amdgpu_dm_connector *aconnector)
aconnector->dc_sink = aconnector->dc_link->local_sink ? aconnector->dc_sink = aconnector->dc_link->local_sink ?
aconnector->dc_link->local_sink : aconnector->dc_link->local_sink :
aconnector->dc_em_sink; aconnector->dc_em_sink;
if (aconnector->dc_sink)
dc_sink_retain(aconnector->dc_sink); dc_sink_retain(aconnector->dc_sink);
} }
} }
...@@ -7929,6 +7931,7 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector) ...@@ -7929,6 +7931,7 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
drm_add_modes_noedid(connector, 1920, 1080); drm_add_modes_noedid(connector, 1920, 1080);
} else { } else {
amdgpu_dm_connector_ddc_get_modes(connector, edid); amdgpu_dm_connector_ddc_get_modes(connector, edid);
if (encoder)
amdgpu_dm_connector_add_common_modes(encoder, connector); amdgpu_dm_connector_add_common_modes(encoder, connector);
amdgpu_dm_connector_add_freesync_modes(connector, edid); amdgpu_dm_connector_add_freesync_modes(connector, edid);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment