drm/amd/display: fix null pointer deref error
Subsystems (3)
PATCH 1/1 drm/amd/display: fix null pointer deref error
[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.
--- .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +6 -3
@@ -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,
Signature · 1 line
2.36.1
Quoted 29 lines · Aurabindo Pillai
[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 <[email protected]>--- .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1
-3@@ -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,
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c static void dce110_setup_audio_dto( · line 2208
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +5
-0&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.
Quoted 30 lines · Rodrigo Siqueira Jordao
Quoted 26 lines · Aurabindo Pillai
[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 <[email protected]>--- .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1
-3@@ -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 };
Quoted 16 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c static void dce110_setup_audio_dto( · line 2208
Quoted 13 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +5
-0pipe_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
Quoted 3 lines
Reviewed-by Rodrigo Siqueira <[email protected]>
Quoted 49 lines · Alex Deucher
Quoted 30 lines · Rodrigo Siqueira Jordao
Quoted 26 lines · Aurabindo Pillai
[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 <[email protected]>--- .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1
-3@@ -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 };Quoted 16 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c static void dce110_setup_audio_dto( · line 2208
Quoted 13 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +5
-0pipe_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.
Quoted 7 lines
Or at least explain in what case you might hit it or an example backtrace.
Alex
Quoted 3 lines
Reviewed-by Rodrigo Siqueira <[email protected]>
Thanks Siqueira & Alex. I'll push with fixes tag and backtrace.