diff mbox

drm/nouveau/tegra: Modify error handling

Message ID 20160815045409.GA12886@amitoj-Inspiron-3542
State Deferred
Headers show

Commit Message

Amitoj Kaur Chawla Aug. 15, 2016, 4:54 a.m. UTC
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(-)

Comments

Alexandre Courbot Aug. 23, 2016, 5:13 p.m. UTC | #1
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>
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 
 		/*