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: <Z9vLuWvzVJOyuuWu@8bytes.org>
Date: Thu, 20 Mar 2025 09:03:05 +0100
From: Joerg Roedel <joro@...tes.org>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
	Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
	iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] iommu/amd: Return a literal in init_gcr3_table()

On Mon, Mar 17, 2025 at 09:43:32AM +0300, Dan Carpenter wrote:
> This code intentionally returns zero but it does it as "return ret;"
> Returning ret looks like an error path where return 0 is more
> clear and looks more intentional.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
>  drivers/iommu/amd/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index ce2626801ddf..7cbcc4933c8b 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -2150,7 +2150,7 @@ static int init_gcr3_table(struct iommu_dev_data *dev_data,
>  
>  	/* Setup GCR3[0] only if domain is setup with v2 page table mode */
>  	if (!pdom_is_v2_pgtbl_mode(pdom))
> -		return ret;
> +		return 0;

There is another case of this a couple lines above in the same function.
Mind changing that as well?

Regards,

	Joerg

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ