lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51440ea7-bbea-c890-057e-109685a72cb3@amd.com>
Date: Tue, 26 Aug 2025 09:31:23 -0700
From: Lizhi Hou <lizhi.hou@....com>
To: Qianfeng Rong <rongqianfeng@...o.com>, Min Ma <min.ma@....com>, Oded
 Gabbay <ogabbay@...nel.org>, <dri-devel@...ts.freedesktop.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] accel/amdxdna: Use int instead of u32 to store error
 codes


On 8/26/25 00:29, Qianfeng Rong wrote:
> Change the 'ret' variable from u32 to int to store -EINVAL, reducing
> potential risks such as incorrect results when comparing 'ret' with
> error codes.

Sounds this fixes code issue. Could you add "Fixes" tag?

Thanks,

Lizhi

> Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
> ---
>   drivers/accel/amdxdna/aie2_ctx.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
> index 420467a5325c..e9f9b1fa5dc1 100644
> --- a/drivers/accel/amdxdna/aie2_ctx.c
> +++ b/drivers/accel/amdxdna/aie2_ctx.c
> @@ -199,7 +199,7 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size)
>   {
>   	struct amdxdna_sched_job *job = handle;
>   	struct amdxdna_gem_obj *cmd_abo;
> -	u32 ret = 0;
> +	int ret = 0;
>   	u32 status;
>   
>   	cmd_abo = job->cmd_bo;
> @@ -229,7 +229,7 @@ static int
>   aie2_sched_nocmd_resp_handler(void *handle, void __iomem *data, size_t size)
>   {
>   	struct amdxdna_sched_job *job = handle;
> -	u32 ret = 0;
> +	int ret = 0;
>   	u32 status;
>   
>   	if (unlikely(!data))
> @@ -257,7 +257,7 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
>   	u32 fail_cmd_status;
>   	u32 fail_cmd_idx;
>   	u32 cmd_status;
> -	u32 ret = 0;
> +	int ret = 0;
>   
>   	cmd_abo = job->cmd_bo;
>   	if (unlikely(!data) || unlikely(size != sizeof(u32) * 3)) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ