[lvc-project] [PATCH 6.1] drm/amd/display: Check null pointers before multiple uses

Fedor Pchelkin pchelkin at ispras.ru
Wed May 14 23:06:23 MSK 2025


On Wed, 14. May 21:14, Aleksandr Burakov wrote:
> From: Alex Hung <alex.hung at amd.com>
> 
> commit fdd5ecbbff751c3b9061d8ebb08e5c96119915b4 upstream.

[...]

> [ Aleksandr Burakov: Introducing only the NULL check in
>   dcn32_enable_phantom_plane() resolves the bug while minimizing risk
>   and preserving stability in the 6.1.y codebase. ]

Подобные патчи от AMD с разовым исправлением множества предупреждений
используемого ими стат. анализатора лучше переносить полностью во всех
частях, что актуальны для целевой стабильной ветки (возможно с некоторой
тривиальной адаптацией, если потребуется). Вдруг на следующей итерации
будет размечена как Confirmed ещё какая-то одна сработка Свейса, которая
также исправлена этим же патчем? Поэтому лучше затаскивать полностью, не
дробя.

Добавление дополнительных проверок на NULL, если уж это было проведено в
upstream, в общем случае не является чем-то слишком *рискованным*, и
обычно достаточно неплохо ложится на stable окромя отдельных случаев
(отсутствие в stable затрагиваемого кода как такового, серьёзное
изменение кодовой базы между версиями и т.п.).

Однако, как и всегда, проводимые подобными патчами изменения необходимо
конечно обдумывать на свежую голову в контексте целевой стабильной ветки.

Для внутренних пересылок патчей заведён список рассылки
lvc-patches at linuxtesting.org.

lvc-project at linuxtesting.org только когда идёт взаимодействие с межд.
сообществом.
https://gitlab.linuxtesting.ru/lvc/guides#списки-рассылки-технологического-центра

> @@ -1664,6 +1664,9 @@ static void dcn32_enable_phantom_plane(struct dc *dc,
>  		else
>  			phantom_plane = dc_create_plane_state(dc);
>  
> +		if !(phantom_plane)
> +			continue;
> +

По очевидным причинам это не соберётся:

Wed May 14 18:54:56 UTC 2025 Using -Oline -j 16 W=1 C=1 ARCH=x86_64 CROSS_COMPILE= redirect to /tmp/tmp.94I55qD0lO and /tmp/tmp.V9IImWxUmS
Wed May 14 18:54:56 UTC 2025 CC=ccache gcc ccache-dir=/builds/pchelkin/linux-stable-rc-ci/ccache
Wed May 14 18:54:56 UTC 2025 gcc (Debian 14.2.0-19) 14.2.0
Wed May 14 18:54:56 UTC 2025 Tree base: c4e76361d8d9 ("net: qrtr: use xa_destroy to free internal radix tree memory")
Wed May 14 18:54:56 UTC 2025 Baseline building the tree: 729b42915af7 ("drm/amd/display: Check null pointers before multiple uses")
../drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.c: In function 'dcn32_enable_phantom_plane':
../drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.c:1667:20: error: expected '(' before '!' token
 1667 |                 if !(phantom_plane)
      |                    ^
      |                    (
../drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.c:1667:20: warning: statement with no effect [-Wunused-value]
 1667 |                 if !(phantom_plane)
      |                    ^~~~~~~~~~~~~~~~
make[6]: *** [../scripts/Makefile.build:250: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.o] Error 1
make[5]: *** [../scripts/Makefile.build:503: drivers/gpu/drm/amd/amdgpu] Error 2
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [../scripts/Makefile.build:503: drivers/gpu/drm] Error 2
make[3]: *** [../scripts/Makefile.build:503: drivers/gpu] Error 2
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [../scripts/Makefile.build:503: drivers] Error 2
make[1]: *** [/builds/pchelkin/linux-stable-rc-ci/linux-linux-6.1-lvc-next/Makefile:2013: .] Error 2
make: *** [Makefile:238: __sub-make] Error 2
Wed May 14 19:34:31 UTC 2025 Exit 1

>  		memcpy(&phantom_plane->address, &curr_pipe->plane_state->address, sizeof(phantom_plane->address));
>  		memcpy(&phantom_plane->scaling_quality, &curr_pipe->plane_state->scaling_quality,
>  				sizeof(phantom_plane->scaling_quality));
> -- 
> 2.40.1



More information about the lvc-project mailing list