All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/tegra: Modify error handling
@ 2016-08-15  4:54 ` Amitoj Kaur Chawla
  0 siblings, 0 replies; 4+ messages in thread
From: Amitoj Kaur Chawla @ 2016-08-15  4:54 UTC (permalink / raw)
  To: bskeggs-H+wXaHxf7aLQT0dZR+AlfA, airlied-cv59FeDIM0c,
	swarren-3lzwWm7+Weoh9ZMKESR00Q,
	thierry.reding-Re5JQEeQqe8AvxtiuMwx3w,
	gnurou-Re5JQEeQqe8AvxtiuMwx3w,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: julia.lawall-L2FTfq7BK8M

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 <amitoj1606-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 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(&platform_bus_type)) {
 		tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type);
-		if (IS_ERR(tdev->iommu.domain))
+		if (!tdev->iommu.domain)
 			goto error;
 
 		/*
-- 
1.9.1

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

* [PATCH] drm/nouveau/tegra: Modify error handling
@ 2016-08-15  4:54 ` Amitoj Kaur Chawla
  0 siblings, 0 replies; 4+ messages in thread
From: Amitoj Kaur Chawla @ 2016-08-15  4:54 UTC (permalink / raw)
  To: bskeggs, airlied, swarren, thierry.reding, gnurou, dri-devel,
	nouveau, linux-tegra, linux-kernel
  Cc: julia.lawall

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 <amitoj1606@gmail.com>
---
 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(&platform_bus_type)) {
 		tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type);
-		if (IS_ERR(tdev->iommu.domain))
+		if (!tdev->iommu.domain)
 			goto error;
 
 		/*
-- 
1.9.1

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

* Re: [PATCH] drm/nouveau/tegra: Modify error handling
  2016-08-15  4:54 ` Amitoj Kaur Chawla
@ 2016-08-23 17:13   ` Alexandre Courbot
  -1 siblings, 0 replies; 4+ messages in thread
From: Alexandre Courbot @ 2016-08-23 17:13 UTC (permalink / raw)
  To: Amitoj Kaur Chawla
  Cc: Stephen Warren, David Airlie,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Linux Kernel Mailing List,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Julia Lawall,
	Ben Skeggs, linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Mon, Aug 15, 2016 at 6:54 AM, Amitoj Kaur Chawla
<amitoj1606@gmail.com> 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 <amitoj1606@gmail.com>

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

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

* Re: [PATCH] drm/nouveau/tegra: Modify error handling
@ 2016-08-23 17:13   ` Alexandre Courbot
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Courbot @ 2016-08-23 17:13 UTC (permalink / raw)
  To: Amitoj Kaur Chawla
  Cc: Ben Skeggs, David Airlie, Stephen Warren, Thierry Reding,
	dri-devel, nouveau, linux-tegra, Linux Kernel Mailing List,
	Julia Lawall

On Mon, Aug 15, 2016 at 6:54 AM, Amitoj Kaur Chawla
<amitoj1606@gmail.com> 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 <amitoj1606@gmail.com>

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

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

end of thread, other threads:[~2016-08-23 17:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-15  4:54 [PATCH] drm/nouveau/tegra: Modify error handling Amitoj Kaur Chawla
2016-08-15  4:54 ` Amitoj Kaur Chawla
2016-08-23 17:13 ` Alexandre Courbot
2016-08-23 17:13   ` Alexandre Courbot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.