mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: Roman Demidov <roman.demidov.nn@gmail.com>,
	Harry Wentland <harry.wentland@amd.com>
Cc: "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>,
	"Gaghik Khachatrian" <gaghik.khachatrian@amd.com>,
	"James Lin" <pinglei.lin@amd.com>,
	"Austin Zheng" <austin.zheng@amd.com>,
	"Bhuvanachandra Pinninti" <BhuvanaChandra.Pinninti@amd.com>,
	"Kees Cook" <kees@kernel.org>,
	"Wenjing Liu" <wenjing.liu@amd.com>,
	"Alvin Lee" <alvin.lee2@amd.com>,
	"Fangzhi Zuo" <Jerry.Zuo@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH] drm/amd/display: Fix NULL deref in dcn401_update_clocks_update_dtb_dto
Date: Fri, 30 Oct 2026 19:44:31 -0600	[thread overview]
Message-ID: <94b0ea91-3fe6-4458-b0c1-14d487a11352@amd.com> (raw)
In-Reply-To: <20261019072938.10074-1-roman.demidov.nn@gmail.com>

Reviewed-by: Alex Hung <alex.hung@amd.com>

On 10/19/26 01:29, Roman Demidov wrote:
> [Why]
> resource_get_otg_master_for_stream() can return NULL if no OTG master pipe
> is found for a given stream. The current code dereferences this pointer
> without a NULL check. This may lead to a possible NULL pointer
> dereference.
> 
> [How]
> Add an explicit NULL check and skip the stream if the OTG master is not
> found. This is similar to dcn60_update_clocks_update_dtb_dto().
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: b6d508533fa1 ("drm/amd/display: fix a crash when clock source is reference for non otg master pipe")
> Signed-off-by: Roman Demidov <roman.demidov.nn@gmail.com>
> ---
>   drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c
> index 6ee3da89d058..135eeef68ac4 100644
> --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c
> +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c
> @@ -538,6 +538,9 @@ static void dcn401_update_clocks_update_dtb_dto(struct clk_mgr_internal *clk_mgr
>   		otg_master = resource_get_otg_master_for_stream(
>   				&context->res_ctx, context->streams[i]);
>   		ASSERT(otg_master);
> +		if (!otg_master)
> +			continue;
> +
>   		ASSERT(otg_master->clock_source);
>   		ASSERT(otg_master->clock_source->funcs->program_pix_clk);
>   		ASSERT(otg_master->stream_res.pix_clk_params.controller_id >= CONTROLLER_ID_D0);


      reply	other threads:[~2026-10-31  1:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  7:29 Roman Demidov
2026-10-31  1:44 ` Alex Hung [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=94b0ea91-3fe6-4458-b0c1-14d487a11352@amd.com \
    --to=alex.hung@amd.com \
    --cc=BhuvanaChandra.Pinninti@amd.com \
    --cc=Jerry.Zuo@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=alvin.lee2@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=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=pinglei.lin@amd.com \
    --cc=roman.demidov.nn@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=wenjing.liu@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®