Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Rodrigo Siqueira Jordao <Rodrigo.Siqueira@amd.com>
To: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: amd-gfx@lists.freedesktop.org, stable@vger.kernel.org,
	Jerry Zuo <jerry.zuo@amd.com>, Jun Lei <Jun.Lei@amd.com>,
	Wayne Lin <Wayne.Lin@amd.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>
Subject: Re: [PATCH v2] drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() & write_dpcd()' functions
Date: Wed, 17 Jan 2024 15:54:48 -0700	[thread overview]
Message-ID: <37c4c2ac-0482-4820-a587-4db03e78ffca@amd.com> (raw)
In-Reply-To: <20240117152327.204465-1-srinivasan.shanmugam@amd.com>

Hi Srinivasan

On 1/17/24 08:23, Srinivasan Shanmugam wrote:
> The 'status' variable in 'core_link_read_dpcd()' &
> 'core_link_write_dpcd()' was uninitialized.
> 
> Thus, initializing 'status' variable to 'DC_ERROR_UNEXPECTED' by default.
> 
> Fixes the below:
> drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dpcd.c:226 core_link_read_dpcd() error: uninitialized symbol 'status'.
> drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dpcd.c:248 core_link_write_dpcd() error: uninitialized symbol 'status'.
> 
> Cc: stable@vger.kernel.org
> Cc: Jerry Zuo <jerry.zuo@amd.com>
> Cc: Jun Lei <Jun.Lei@amd.com>
> Cc: Wayne Lin <Wayne.Lin@amd.com>
> Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
> Cc: Hamza Mahfooz <hamza.mahfooz@amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>


This change lgtm.

Btw, avoid to send new patches as a reply of the previous one.

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

Thanks
Siqueira

> ---
> v2:
>    - Initialized status variable to 'DC_ERROR_UNEXPECTED' default.
>    - Added Jerry to Cc
> 
>   drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c
> index 5c9a30211c10..fc50931c2aec 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c
> @@ -205,7 +205,7 @@ enum dc_status core_link_read_dpcd(
>   	uint32_t extended_size;
>   	/* size of the remaining partitioned address space */
>   	uint32_t size_left_to_read;
> -	enum dc_status status;
> +	enum dc_status status = DC_ERROR_UNEXPECTED;
>   	/* size of the next partition to be read from */
>   	uint32_t partition_size;
>   	uint32_t data_index = 0;
> @@ -234,7 +234,7 @@ enum dc_status core_link_write_dpcd(
>   {
>   	uint32_t partition_size;
>   	uint32_t data_index = 0;
> -	enum dc_status status;
> +	enum dc_status status = DC_ERROR_UNEXPECTED;
>   
>   	while (size) {
>   		partition_size = dpcd_get_next_partition_size(address, size);


      reply	other threads:[~2024-01-17 22:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17  3:23 [PATCH] drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() & write_dpcd()' functions Srinivasan Shanmugam
2024-01-17  5:18 ` [PATCH v2] " Srinivasan Shanmugam
2024-01-17 15:23 ` Srinivasan Shanmugam
2024-01-17 22:54   ` 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=37c4c2ac-0482-4820-a587-4db03e78ffca@amd.com \
    --to=rodrigo.siqueira@amd.com \
    --cc=Jun.Lei@amd.com \
    --cc=Wayne.Lin@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=hamza.mahfooz@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=srinivasan.shanmugam@amd.com \
    --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