iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] iommu/sun50i: Fix return value check in sun50i_iommu_probe()
@ 2020-05-19  9:18 Wei Yongjun
  2020-05-19  9:19 ` Maxime Ripard
  2020-05-19 12:06 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2020-05-19  9:18 UTC (permalink / raw)
  To: Joerg Roedel, Maxime Ripard, Chen-Yu Tsai, Philipp Zabel, Maxime Ripard
  Cc: kernel-janitors, linux-kernel, Hulk Robot, iommu, Wei Yongjun,
	linux-arm-kernel

In case of error, the function devm_platform_ioremap_resource() returns
ERR_PTR() not NULL. The NULL test in the return value check must be
replaced with IS_ERR().

Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/iommu/sun50i-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index 9c763d4a8e2a..1fa09ddcebd4 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -941,7 +941,7 @@ static int sun50i_iommu_probe(struct platform_device *pdev)
 	}
 
 	iommu->base = devm_platform_ioremap_resource(pdev, 0);
-	if (!iommu->base) {
+	if (IS_ERR(iommu->base)) {
 		ret = PTR_ERR(iommu->base);
 		goto err_free_group;
 	}



_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH -next] iommu/sun50i: Fix return value check in sun50i_iommu_probe()
  2020-05-19  9:18 [PATCH -next] iommu/sun50i: Fix return value check in sun50i_iommu_probe() Wei Yongjun
@ 2020-05-19  9:19 ` Maxime Ripard
  2020-05-19 12:06 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2020-05-19  9:19 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: kernel-janitors, Chen-Yu Tsai, linux-kernel, Hulk Robot, iommu,
	Philipp Zabel, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 472 bytes --]

On Tue, May 19, 2020 at 09:18:57AM +0000, Wei Yongjun wrote:
> In case of error, the function devm_platform_ioremap_resource() returns
> ERR_PTR() not NULL. The NULL test in the return value check must be
> replaced with IS_ERR().
> 
> Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH -next] iommu/sun50i: Fix return value check in sun50i_iommu_probe()
  2020-05-19  9:18 [PATCH -next] iommu/sun50i: Fix return value check in sun50i_iommu_probe() Wei Yongjun
  2020-05-19  9:19 ` Maxime Ripard
@ 2020-05-19 12:06 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2020-05-19 12:06 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: kernel-janitors, iommu, Maxime Ripard, linux-kernel, Hulk Robot,
	Chen-Yu Tsai, Maxime Ripard, Philipp Zabel, linux-arm-kernel

On Tue, May 19, 2020 at 09:18:57AM +0000, Wei Yongjun wrote:
> In case of error, the function devm_platform_ioremap_resource() returns
> ERR_PTR() not NULL. The NULL test in the return value check must be
> replaced with IS_ERR().
> 
> Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/iommu/sun50i-iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2020-05-19 12:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19  9:18 [PATCH -next] iommu/sun50i: Fix return value check in sun50i_iommu_probe() Wei Yongjun
2020-05-19  9:19 ` Maxime Ripard
2020-05-19 12:06 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).