Re: [Nouveau] [PATCH] drm/nouveau/tegra: Modify error handling

2016-08-23 Thread Alexandre Courbot
On Mon, Aug 15, 2016 at 6:54 AM, Amitoj Kaur Chawla
 wrote:
> iommu_domain_alloc returns NULL on error so replace an incorrect
> IS_ERR check with a NULL check.
>
> The Coccinelle semantic patch used to find this issue is as follows:
> @@
> expression e;
> statement S;
> @@
>
> *e = iommu_domain_alloc(...);
> if (IS_ERR(e)) S
>
> Signed-off-by: Amitoj Kaur Chawla 

Reviewed-by: Alexandre Courbot 
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [PATCH] drm/nouveau/tegra: Modify error handling

2016-08-15 Thread Amitoj Kaur Chawla
iommu_domain_alloc returns NULL on error so replace an incorrect
IS_ERR check with a NULL check.

The Coccinelle semantic patch used to find this issue is as follows:
@@
expression e;
statement S;
@@

*e = iommu_domain_alloc(...);
if (IS_ERR(e)) S

Signed-off-by: Amitoj Kaur Chawla 
---
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
index 939682f..ffd8def 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
@@ -102,7 +102,7 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra 
*tdev)
 
if (iommu_present(_bus_type)) {
tdev->iommu.domain = iommu_domain_alloc(_bus_type);
-   if (IS_ERR(tdev->iommu.domain))
+   if (!tdev->iommu.domain)
goto error;
 
/*
-- 
1.9.1

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau