LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Rodrigo Siqueira Jordao <rjordrigo@amd.com>
To: cgel.zte@gmail.com, sunpeng.li@amd.com
Cc: harry.wentland@amd.com, Rodrigo.Siqueira@amd.com,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch,
	jun.lei@amd.com, wayne.lin@amd.com, lv.ruyi@zte.com.cn,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] drm/amd/display: fix application of sizeof to pointer
Date: Thu, 25 Nov 2021 11:32:30 -0500	[thread overview]
Message-ID: <15100102-406d-c327-42b6-fe83b446122b@amd.com> (raw)
In-Reply-To: <20211124030426.34830-1-lv.ruyi@zte.com.cn>



On 2021-11-23 10:04 p.m., cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> Both of split and merge are pointers, not arrays.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> ---
>   drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c b/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c
> index ece34b0b8a46..91810aaee5a3 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c
> @@ -1223,8 +1223,8 @@ static void dml_full_validate_bw_helper(struct dc *dc,
>   		*pipe_cnt = dml_populate_dml_pipes_from_context(dc, context, pipes, false);
>   		*vlevel = dml_get_voltage_level(&context->bw_ctx.dml, pipes, *pipe_cnt);
>   		if (*vlevel < context->bw_ctx.dml.soc.num_states) {
> -			memset(split, 0, sizeof(split));
> -			memset(merge, 0, sizeof(merge));
> +			memset(split, 0, MAX_PIPES * sizeof(*split));
> +			memset(merge, 0, MAX_PIPES * sizeof(*merge));
>   			*vlevel = dml_validate_apply_pipe_split_flags(dc, context, *vlevel, split, merge);
>   		}
>   
> 
Nice catch!

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>

and applied to amd-staging-drm-next

Thanks
Siqueira

      reply	other threads:[~2021-11-25 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24  3:04 cgel.zte
2021-11-25 16:32 ` Rodrigo Siqueira Jordao [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=15100102-406d-c327-42b6-fe83b446122b@amd.com \
    --to=rjordrigo@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=cgel.zte@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=jun.lei@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.ruyi@zte.com.cn \
    --cc=sunpeng.li@amd.com \
    --cc=wayne.lin@amd.com \
    --cc=zealci@zte.com.cn \
    --subject='Re: [PATCH] drm/amd/display: fix application of sizeof to pointer' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).