Skip to content

Commit

Permalink
drm/amd/display: Add null check to dc_submit_i2c_oem
Browse files Browse the repository at this point in the history
[why]
dc_submit_i2c_oem could be called with ddc null

[how]
add null check and fail the call instead

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Martin Leung <martin.leung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Martin Leung authored and Alex Deucher committed Jun 15, 2022
1 parent ac31a24 commit ac78fa5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/gpu/drm/amd/display/dc/core/dc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3477,10 +3477,13 @@ bool dc_submit_i2c_oem(
struct i2c_command *cmd)
{
struct ddc_service *ddc = dc->res_pool->oem_device;
return dce_i2c_submit_command(
dc->res_pool,
ddc->ddc_pin,
cmd);
if (ddc)
return dce_i2c_submit_command(
dc->res_pool,
ddc->ddc_pin,
cmd);

return false;
}

static bool link_add_remote_sink_helper(struct dc_link *dc_link, struct dc_sink *sink)
Expand Down

0 comments on commit ac78fa5

Please sign in to comment.