linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/tegra: Modify error handling
@ 2016-08-15  4:54 Amitoj Kaur Chawla
  2016-08-23 17:13 ` Alexandre Courbot
  0 siblings, 1 reply; 2+ 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] 2+ messages in thread

* Re: [PATCH] drm/nouveau/tegra: Modify error handling
  2016-08-15  4:54 [PATCH] drm/nouveau/tegra: Modify error handling Amitoj Kaur Chawla
@ 2016-08-23 17:13 ` Alexandre Courbot
  0 siblings, 0 replies; 2+ 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] 2+ messages in thread

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

Thread overview: 2+ 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-23 17:13 ` Alexandre Courbot

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).