Commit ac78fa50 authored by Martin Leung's avatar Martin Leung Committed by Alex Deucher

drm/amd/display: Add null check to dc_submit_i2c_oem

[why]
dc_submit_i2c_oem could be called with ddc null

[how]
add null check and fail the call instead
Acked-by: default avatarAlan Liu <HaoPing.Liu@amd.com>
Signed-off-by: default avatarMartin Leung <martin.leung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ac31a24d
......@@ -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)
......
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