Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1462549 > unrolled thread

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

Started byAmitoj Kaur Chawla <amitoj1606@gmail.com>
First post2016-08-15 07:00 +0200
Last post2016-08-23 19:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drm/nouveau/tegra: Modify error handling Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2016-08-15 07:00 +0200
    Re: [PATCH] drm/nouveau/tegra: Modify error handling Alexandre Courbot <gnurou@gmail.com> - 2016-08-23 19:30 +0200

#1462549 — [PATCH] drm/nouveau/tegra: Modify error handling

FromAmitoj Kaur Chawla <amitoj1606@gmail.com>
Date2016-08-15 07:00 +0200
Subject[PATCH] drm/nouveau/tegra: Modify error handling
Message-ID<s6iad-We-9@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1468736

FromAlexandre Courbot <gnurou@gmail.com>
Date2016-08-23 19:30 +0200
Message-ID<s9nGp-72m-15@gated-at.bofh.it>
In reply to#1462549
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>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web