[PATCH] drm/amd/display: fix null pointer deref error

Aurabindo Pillai aurabindo.pillai at amd.com
Tue Jun 7 18:24:35 UTC 2022



On 2022-06-07 13:41, Alex Deucher wrote:
> On Tue, Jun 7, 2022 at 1:40 PM Rodrigo Siqueira Jordao
> <Rodrigo.Siqueira at amd.com> wrote:
>>
>>
>>
>> On 2022-06-07 13:06, Aurabindo Pillai wrote:
>>> [Why]
>>> 0 was passed in place of a pointer which triggered null pointer
>>> dereference.
>>>
>>> [How]
>>> Pass in a pointer that contains nullified parameters instead of null
>>> pointer.
>>>
>>> Signed-off-by: Aurabindo Pillai <aurabindo.pillai at amd.com>
>>> ---
>>>    .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c  | 9 ++++++---
>>>    1 file changed, 6 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
>>> index 631a8a2f9fc3..e7944c881148 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
>>> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
>>> @@ -2191,15 +2191,18 @@ static void dce110_setup_audio_dto(
>>>                        build_audio_output(context, pipe_ctx, &audio_output);
>>>
>>>                        if (dc->res_pool->dccg && dc->res_pool->dccg->funcs->set_audio_dtbclk_dto) {
>>> -                             /* disable audio DTBCLK DTO */
>>> -                             dc->res_pool->dccg->funcs->set_audio_dtbclk_dto(
>>> -                                     dc->res_pool->dccg, 0);
>>> +                             struct dtbclk_dto_params dto_params = {0};
>>>
>>>                                pipe_ctx->stream_res.audio->funcs->wall_dto_setup(
>>>                                                pipe_ctx->stream_res.audio,
>>>                                                pipe_ctx->stream->signal,
>>>                                                &audio_output.crtc_info,
>>>                                                &audio_output.pll_info);
>>> +
>>> +                             /* disable audio DTBCLK DTO */
>>> +                             dc->res_pool->dccg->funcs->set_audio_dtbclk_dto(
>>> +                                     dc->res_pool->dccg, &dto_params);
>>> +
>>>                        } else
>>>                                pipe_ctx->stream_res.audio->funcs->wall_dto_setup(
>>>                                        pipe_ctx->stream_res.audio,
>>
>> Maybe it is a good idea to add the Fixes tag that points to the commit
>> that introduced this regression. Anyway, I'm ok with this change.
> 
> Or at least explain in what case you might hit it or an example backtrace.
> 
> Alex
> 
>>
>> Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
>>
Thanks Siqueira & Alex. I'll push with fixes tag and backtrace.


More information about the amd-gfx mailing list