mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
drm/amd/display: Fix potential NULL pointer dereferences in 'dcn10_set_output_transfer_func()'
[ Upstream commit9ccfe80d02
] The 'stream' pointer is used in dcn10_set_output_transfer_func() before the check if 'stream' is NULL. Fixes the below: drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dcn10/dcn10_hwseq.c:1892 dcn10_set_output_transfer_func() warn: variable dereferenced before check 'stream' (see line 1875) Fixes:ddef02de0d
("drm/amd/display: add null checks before logging") Cc: Wyatt Wood <wyatt.wood@amd.com> Cc: Anthony Koo <Anthony.Koo@amd.com> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Cc: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Reviewed-by: Anthony Koo <Anthony.Koo@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1d4d674173
commit
e019d87e02
1 changed files with 5 additions and 2 deletions
|
@ -1470,6 +1470,9 @@ dcn10_set_output_transfer_func(struct pipe_ctx *pipe_ctx,
|
||||||
{
|
{
|
||||||
struct dpp *dpp = pipe_ctx->plane_res.dpp;
|
struct dpp *dpp = pipe_ctx->plane_res.dpp;
|
||||||
|
|
||||||
|
if (!stream)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (dpp == NULL)
|
if (dpp == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1492,8 +1495,8 @@ dcn10_set_output_transfer_func(struct pipe_ctx *pipe_ctx,
|
||||||
} else
|
} else
|
||||||
dpp->funcs->dpp_program_regamma_pwl(dpp, NULL, OPP_REGAMMA_BYPASS);
|
dpp->funcs->dpp_program_regamma_pwl(dpp, NULL, OPP_REGAMMA_BYPASS);
|
||||||
|
|
||||||
if (stream != NULL && stream->ctx != NULL &&
|
if (stream->ctx &&
|
||||||
stream->out_transfer_func != NULL) {
|
stream->out_transfer_func) {
|
||||||
log_tf(stream->ctx,
|
log_tf(stream->ctx,
|
||||||
stream->out_transfer_func,
|
stream->out_transfer_func,
|
||||||
dpp->regamma_params.hw_points_num);
|
dpp->regamma_params.hw_points_num);
|
||||||
|
|
Loading…
Reference in a new issue