Skip to content

Commit 5d978e7

Browse files
melissawenalexdeucher
authored andcommitted
drm/amd/display: check dc_link before dereferencing
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:6683 amdgpu_dm_connector_funcs_force() warn: variable dereferenced before check 'dc_link' (see line 6663) Fixes: 9671761 ("drm/amd/display: fix null-pointer dereference on edid reading") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 2c684b9 commit 5d978e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6653,7 +6653,7 @@ static void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
66536653
struct edid *edid;
66546654
struct i2c_adapter *ddc;
66556655

6656-
if (dc_link->aux_mode)
6656+
if (dc_link && dc_link->aux_mode)
66576657
ddc = &aconnector->dm_dp_aux.aux.ddc;
66586658
else
66596659
ddc = &aconnector->i2c->base;

0 commit comments

Comments
 (0)