Commit bc19909f authored by Nicholas Kazlauskas's avatar Nicholas Kazlauskas Committed by Alex Deucher

drm/amd/display: Guard against ddc_pin being NULL for AUX

[Why]
In the case where we don't support DMUB aux but we have DPIA links
in the configuration we might try to message AUX using the legacy
path - where DDC pin is NULL. This causes a NULL pointer dereference.

[How]
Guard against NULL DDC pin, return a failure for aux engine acquire.
Reviewed-by: default avatarMichael Strauss <Michael.Strauss@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7c50a3e9
...@@ -572,6 +572,11 @@ int dce_aux_transfer_raw(struct ddc_service *ddc, ...@@ -572,6 +572,11 @@ int dce_aux_transfer_raw(struct ddc_service *ddc,
memset(&aux_req, 0, sizeof(aux_req)); memset(&aux_req, 0, sizeof(aux_req));
if (ddc_pin == NULL) {
*operation_result = AUX_RET_ERROR_ENGINE_ACQUIRE;
return -1;
}
aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]; aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en];
if (!acquire(aux_engine, ddc_pin)) { if (!acquire(aux_engine, ddc_pin)) {
*operation_result = AUX_RET_ERROR_ENGINE_ACQUIRE; *operation_result = AUX_RET_ERROR_ENGINE_ACQUIRE;
......
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