Skip to content

Commit 019fe97

Browse files
Yang Ligregkh
authored andcommitted
drm/amd/display: check top_pipe_to_program pointer
[ Upstream commit a689e8d ] Clang static analysis reports this error drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:2870:7: warning: Dereference of null pointer [clang-analyzer-core.NullDereference] if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) { ^ top_pipe_to_program being NULL is caught as an error But then it is used to report the error. So add a check before using it. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3c3c0b6 commit 019fe97

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • drivers/gpu/drm/amd/display/dc/core

‎drivers/gpu/drm/amd/display/dc/core/dc.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2436,7 +2436,8 @@ static void commit_planes_for_stream(struct dc *dc,
24362436
}
24372437

24382438
if ((update_type != UPDATE_TYPE_FAST) && stream->update_flags.bits.dsc_changed)
2439-
if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
2439+
if (top_pipe_to_program &&
2440+
top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
24402441
if (should_use_dmub_lock(stream->link)) {
24412442
union dmub_hw_lock_flags hw_locks = { 0 };
24422443
struct dmub_hw_lock_inst_flags inst_flags = { 0 };

0 commit comments

Comments
 (0)