]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: check top_pipe_to_program pointer
authorYang Li <yang.lee@linux.alibaba.com>
Mon, 15 Nov 2021 08:10:19 +0000 (16:10 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 22 Nov 2021 19:45:03 +0000 (14:45 -0500)
commit3b6ae534d7ca9365867d07ef00db1aeeb0fcf03c
treea1c835e853df366f8aefb80d4cfa6344d3d056d7
parenteacfde269ba3487f080c40c1283c7ff3268f3314
drm/amd/display: check top_pipe_to_program pointer

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>
drivers/gpu/drm/amd/display/dc/core/dc.c