mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: Ma Ke <make24@iscas.ac.cn>,
	dillon.varone@amd.com, Samson.Tam@amd.com, chris.park@amd.com,
	aurabindo.pillai@amd.com, george.shen@amd.com,
	gabe.teeger@amd.com, Yihan.Zhu@amd.com, Tony.Cheng@amd.com
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] drm/amd/display: Fix null check for pipe_ctx->plane_state in resource_build_scaling_params
Date: Wed, 26 Feb 2025 11:47:48 -0700	[thread overview]
Message-ID: <749a1601-fa9f-468b-92d1-1a1548a08471@amd.com> (raw)
In-Reply-To: <20250226083731.3584509-1-make24@iscas.ac.cn>

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

On 2/26/25 01:37, Ma Ke wrote:
> Null pointer dereference issue could occur when pipe_ctx->plane_state
> is null. The fix adds a check to ensure 'pipe_ctx->plane_state' is not
> null before accessing. This prevents a null pointer dereference.
> 
> Found by code review.
> 
> Cc: stable@vger.kernel.org
> Fixes: 3be5262e353b ("drm/amd/display: Rename more dc_surface stuff to plane_state")
> Signed-off-by: Ma Ke <make24@iscas.ac.cn>
> ---
> Changes in v2:
> - modified the patch as suggestions.
> ---
>   drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> index 520a34a42827..a45037cb4cc0 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> @@ -1455,7 +1455,8 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
>   	DC_LOGGER_INIT(pipe_ctx->stream->ctx->logger);
>   
>   	/* Invalid input */
> -	if (!plane_state->dst_rect.width ||
> +	if (!plane_state ||
> +			!plane_state->dst_rect.width ||
>   			!plane_state->dst_rect.height ||
>   			!plane_state->src_rect.width ||
>   			!plane_state->src_rect.height) {


  reply	other threads:[~2025-02-26 18:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26  8:37 Ma Ke
2025-02-26 18:47 ` Alex Hung [this message]
2025-02-26 19:16   ` Alex Deucher

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=749a1601-fa9f-468b-92d1-1a1548a08471@amd.com \
    --to=alex.hung@amd.com \
    --cc=Samson.Tam@amd.com \
    --cc=Tony.Cheng@amd.com \
    --cc=Yihan.Zhu@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=chris.park@amd.com \
    --cc=dillon.varone@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gabe.teeger@amd.com \
    --cc=george.shen@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=make24@iscas.ac.cn \
    --cc=stable@vger.kernel.org \
    /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®