public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check
@ 2024-08-15 11:25 Dan Carpenter
  2024-08-15 12:06 ` Jason Gunthorpe
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2024-08-15 11:25 UTC (permalink / raw)
  To: Shameer Kolothum
  Cc: Will Deacon, Robin Murphy, Joerg Roedel, Jason Gunthorpe,
	Nicolin Chen, Michael Shavit, Mostafa Saleh, Lu Baolu, Kevin Tian,
	linux-arm-kernel, iommu, linux-kernel, kernel-janitors

The arm_smmu_domain_alloc() function returns error pointers on error.  It
doesn't return NULL.  Update the error checking to match.

Fixes: 52acd7d8a413 ("iommu/arm-smmu-v3: Add support for domain_alloc_user fn")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 9bc50bded5af..cf21d7d2e737 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -3062,8 +3062,8 @@ arm_smmu_domain_alloc_user(struct device *dev, u32 flags,
 		return ERR_PTR(-EOPNOTSUPP);
 
 	smmu_domain = arm_smmu_domain_alloc();
-	if (!smmu_domain)
-		return ERR_PTR(-ENOMEM);
+	if (IS_ERR(smmu_domain))
+		return ERR_CAST(smmu_domain);
 
 	smmu_domain->domain.type = IOMMU_DOMAIN_UNMANAGED;
 	smmu_domain->domain.ops = arm_smmu_ops.default_domain_ops;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check
  2024-08-15 11:25 [PATCH] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check Dan Carpenter
@ 2024-08-15 12:06 ` Jason Gunthorpe
  2024-08-15 13:03 ` Shameerali Kolothum Thodi
  2024-08-16 15:15 ` Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2024-08-15 12:06 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Shameer Kolothum, Will Deacon, Robin Murphy, Joerg Roedel,
	Nicolin Chen, Michael Shavit, Mostafa Saleh, Lu Baolu, Kevin Tian,
	linux-arm-kernel, iommu, linux-kernel, kernel-janitors

On Thu, Aug 15, 2024 at 02:25:00PM +0300, Dan Carpenter wrote:
> The arm_smmu_domain_alloc() function returns error pointers on error.  It
> doesn't return NULL.  Update the error checking to match.
> 
> Fixes: 52acd7d8a413 ("iommu/arm-smmu-v3: Add support for domain_alloc_user fn")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Yeah, looks like this was missed during a rebase

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check
  2024-08-15 11:25 [PATCH] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check Dan Carpenter
  2024-08-15 12:06 ` Jason Gunthorpe
@ 2024-08-15 13:03 ` Shameerali Kolothum Thodi
  2024-08-16 15:15 ` Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Shameerali Kolothum Thodi @ 2024-08-15 13:03 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Will Deacon, Robin Murphy, Joerg Roedel, Jason Gunthorpe,
	Nicolin Chen, Michael Shavit, Mostafa Saleh, Lu Baolu, Kevin Tian,
	linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org



> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@linaro.org>
> Sent: Thursday, August 15, 2024 12:25 PM
> To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
> Cc: Will Deacon <will@kernel.org>; Robin Murphy
> <robin.murphy@arm.com>; Joerg Roedel <joro@8bytes.org>; Jason
> Gunthorpe <jgg@ziepe.ca>; Nicolin Chen <nicolinc@nvidia.com>; Michael
> Shavit <mshavit@google.com>; Mostafa Saleh <smostafa@google.com>; Lu
> Baolu <baolu.lu@linux.intel.com>; Kevin Tian <kevin.tian@intel.com>; linux-
> arm-kernel@lists.infradead.org; iommu@lists.linux.dev; linux-
> kernel@vger.kernel.org; kernel-janitors@vger.kernel.org
> Subject: [PATCH] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check
> 
> The arm_smmu_domain_alloc() function returns error pointers on error.  It
> doesn't return NULL.  Update the error checking to match.
> 
> Fixes: 52acd7d8a413 ("iommu/arm-smmu-v3: Add support for
> domain_alloc_user fn")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>

Thanks,
Shameer

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check
  2024-08-15 11:25 [PATCH] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check Dan Carpenter
  2024-08-15 12:06 ` Jason Gunthorpe
  2024-08-15 13:03 ` Shameerali Kolothum Thodi
@ 2024-08-16 15:15 ` Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2024-08-16 15:15 UTC (permalink / raw)
  To: Shameer Kolothum, Dan Carpenter
  Cc: catalin.marinas, kernel-team, Will Deacon, Robin Murphy,
	Joerg Roedel, Jason Gunthorpe, Nicolin Chen, Michael Shavit,
	Mostafa Saleh, Lu Baolu, Kevin Tian, linux-arm-kernel, iommu,
	linux-kernel, kernel-janitors

On Thu, 15 Aug 2024 14:25:00 +0300, Dan Carpenter wrote:
> The arm_smmu_domain_alloc() function returns error pointers on error.  It
> doesn't return NULL.  Update the error checking to match.
> 
> 

Applied to will (for-joerg/arm-smmu/updates), thanks!

[1/1] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check
      https://git.kernel.org/will/c/af048ec9c051

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-16 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15 11:25 [PATCH] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check Dan Carpenter
2024-08-15 12:06 ` Jason Gunthorpe
2024-08-15 13:03 ` Shameerali Kolothum Thodi
2024-08-16 15:15 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox