From: George Zhang <george.zhang@amd.com>
To: Dmitriy Chumachenko <Dmitry.Chumachenko@cyberprotect.ru>,
Austin Zheng <austin.zheng@amd.com>
Cc: "Jun Lei" <jun.lei@amd.com>,
"Harry Wentland" <harry.wentland@amd.com>,
"Leo Li" <sunpeng.li@amd.com>,
"Rodrigo Siqueira" <siqueira@igalia.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Dillon Varone" <dillon.varone@amd.com>,
"Nicholas Carbones" <Nicholas.Carbones@amd.com>,
"Wayne Lin" <wayne.lin@amd.com>, "Ray Wu" <ray.wu@amd.com>,
"Gaghik Khachatrian" <gaghik.khachatrian@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: drm/amd/display: guard NULL secondary pipe in dcn_validate_bandwidth()
Date: Fri, 4 Dec 2026 14:46:40 -0500 [thread overview]
Message-ID: <cd279e66-dfc8-4521-96ed-5b36a4e62848@amd.com> (raw)
In-Reply-To: <20260914151446.94380-1-Dmitry.Chumachenko@cyberprotect.ru>
On 9/14/26 11:14, Dmitriy Chumachenko wrote:
> resource_find_free_secondary_pipe_legacy() returns NULL when no free
> pipe is available, but the result is only passed to ASSERT() (a
> WARN_ON_ONCE() that does not stop execution) and then dereferenced in
> split_stream_across_pipes() and dcn_bw_calc_rq_dlg_ttu().
>
> The sibling resource callers (dcn10/dcn20/dcn201) already NULL-check
> this function's result. Do the same here and skip the split when no
> free pipe is available.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 74c49c7ac14f ("drm/amdgpu/display: Add calcs code for DCN")
> Signed-off-by: Dmitriy Chumachenko <Dmitry.Chumachenko@cyberprotect.ru>
Reviewed-by: George Zhang <george.zhang@amd.com>
> ---
> drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c b/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c
> index 61553e24d53e..de54807ade43 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c
> @@ -1261,10 +1261,12 @@ bool dcn_validate_bandwidth(
> /* pipe not split previously needs split */
> hsplit_pipe = resource_find_free_secondary_pipe_legacy(&context->res_ctx, pool, pipe);
> ASSERT(hsplit_pipe);
> - split_stream_across_pipes(&context->res_ctx, pool, pipe, hsplit_pipe);
> + if (hsplit_pipe)
> + split_stream_across_pipes(&context->res_ctx, pool, pipe, hsplit_pipe);
> }
>
> - dcn_bw_calc_rq_dlg_ttu(dc, v, hsplit_pipe, input_idx);
> + if (hsplit_pipe)
> + dcn_bw_calc_rq_dlg_ttu(dc, v, hsplit_pipe, input_idx);
> } else if (hsplit_pipe && hsplit_pipe->plane_state == pipe->plane_state) {
> /* merge previously split pipe */
> pipe->bottom_pipe = hsplit_pipe->bottom_pipe;
prev parent reply other threads:[~2026-12-04 19:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 15:14 [PATCH] " Dmitriy Chumachenko
2026-12-04 19:46 ` George Zhang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cd279e66-dfc8-4521-96ed-5b36a4e62848@amd.com \
--to=george.zhang@amd.com \
--cc=Dmitry.Chumachenko@cyberprotect.ru \
--cc=Nicholas.Carbones@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=austin.zheng@amd.com \
--cc=christian.koenig@amd.com \
--cc=dillon.varone@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gaghik.khachatrian@amd.com \
--cc=harry.wentland@amd.com \
--cc=jun.lei@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=ray.wu@amd.com \
--cc=simona@ffwll.ch \
--cc=siqueira@igalia.com \
--cc=sunpeng.li@amd.com \
--cc=wayne.lin@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®