mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
To: Lizhi Hou <lizhi.hou@amd.com>,
	ogabbay@kernel.org, quic_jhugo@quicinc.com,
	maciej.falkowski@linux.intel.com,
	dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, max.zhen@amd.com, sonal.santan@amd.com
Subject: Re: [PATCH] accel/amdxdna: Fix uninitialized return value
Date: Fri, 24 Oct 2025 13:07:28 -0500	[thread overview]
Message-ID: <ab69ff44-14a5-4f65-a026-c08d9931c2c1@kernel.org> (raw)
In-Reply-To: <20251024165503.1548131-1-lizhi.hou@amd.com>



On 10/24/2025 11:55 AM, Lizhi Hou wrote:
> In aie2_get_hwctx_status() and aie2_query_ctx_status_array(), the
> functions could return an uninitialized value in some cases. Update them
> to always return 0. The amount of valid results is indicated by the
> returned buffer_size, element_size, and num_element fields.
> 
> Fixes: 2f509fe6a42c ("accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY")
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>> ---
>   drivers/accel/amdxdna/aie2_pci.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c
> index f48045318dc0..f1a8112b080f 100644
> --- a/drivers/accel/amdxdna/aie2_pci.c
> +++ b/drivers/accel/amdxdna/aie2_pci.c
> @@ -822,7 +822,7 @@ static int aie2_get_hwctx_status(struct amdxdna_client *client,
>   	}
>   
>   	args->buffer_size -= (u32)(array_args.buffer - args->buffer);
> -	return ret;
> +	return 0;
>   }
>   
>   static int aie2_get_info(struct amdxdna_client *client, struct amdxdna_drm_get_info *args)
> @@ -904,7 +904,7 @@ static int aie2_query_ctx_status_array(struct amdxdna_client *client,
>   	args->num_element = (u32)((array_args.buffer - args->buffer) /
>   				  args->element_size);
>   
> -	return ret;
> +	return 0;
>   }
>   
>   static int aie2_get_array(struct amdxdna_client *client,


  reply	other threads:[~2025-10-24 18:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24 16:55 Lizhi Hou
2025-10-24 18:07 ` Mario Limonciello (AMD) (kernel.org) [this message]
2025-10-24 20:09   ` Lizhi Hou

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=ab69ff44-14a5-4f65-a026-c08d9931c2c1@kernel.org \
    --to=superm1@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=maciej.falkowski@linux.intel.com \
    --cc=max.zhen@amd.com \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=sonal.santan@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®