* [PATCH] drm/amd/display: fix null pointer deref error
@ 2022-06-07 17:06 Aurabindo Pillai
2022-06-07 17:40 ` Rodrigo Siqueira Jordao
0 siblings, 1 reply; 4+ messages in thread
From: Aurabindo Pillai @ 2022-06-07 17:06 UTC (permalink / raw)
To: amd-gfx; +Cc: jerry.zuo, aurabindo.pillai, rodrigo.siqueira
[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@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,
--
2.36.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/display: fix null pointer deref error
2022-06-07 17:06 [PATCH] drm/amd/display: fix null pointer deref error Aurabindo Pillai
@ 2022-06-07 17:40 ` Rodrigo Siqueira Jordao
2022-06-07 17:41 ` Alex Deucher
0 siblings, 1 reply; 4+ messages in thread
From: Rodrigo Siqueira Jordao @ 2022-06-07 17:40 UTC (permalink / raw)
To: Aurabindo Pillai, amd-gfx; +Cc: jerry.zuo
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@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.
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/display: fix null pointer deref error
2022-06-07 17:40 ` Rodrigo Siqueira Jordao
@ 2022-06-07 17:41 ` Alex Deucher
2022-06-07 18:24 ` Aurabindo Pillai
0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2022-06-07 17:41 UTC (permalink / raw)
To: Rodrigo Siqueira Jordao; +Cc: Jerry Zuo, Aurabindo Pillai, amd-gfx list
On Tue, Jun 7, 2022 at 1:40 PM Rodrigo Siqueira Jordao
<Rodrigo.Siqueira@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@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@amd.com>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/display: fix null pointer deref error
2022-06-07 17:41 ` Alex Deucher
@ 2022-06-07 18:24 ` Aurabindo Pillai
0 siblings, 0 replies; 4+ messages in thread
From: Aurabindo Pillai @ 2022-06-07 18:24 UTC (permalink / raw)
To: Alex Deucher, Rodrigo Siqueira Jordao; +Cc: Jerry Zuo, amd-gfx list
On 2022-06-07 13:41, Alex Deucher wrote:
> On Tue, Jun 7, 2022 at 1:40 PM Rodrigo Siqueira Jordao
> <Rodrigo.Siqueira@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@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@amd.com>
>>
Thanks Siqueira & Alex. I'll push with fixes tag and backtrace.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-06-07 18:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-07 17:06 [PATCH] drm/amd/display: fix null pointer deref error Aurabindo Pillai
2022-06-07 17:40 ` Rodrigo Siqueira Jordao
2022-06-07 17:41 ` Alex Deucher
2022-06-07 18:24 ` Aurabindo Pillai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.