[-next] drm/nouveau/device: fix return value check in nvkm_device_tegra_probe_iommu()

Submitted by weiyj_lk@163.com on July 6, 2016, 12:23 p.m.

Details

Message ID 1467807785-32126-1-git-send-email-weiyj_lk@163.com
State New
Headers show
Series "drm/nouveau/device: fix return value check in nvkm_device_tegra_probe_iommu()" ( rev: 1 ) in Nouveau

Not browsing as part of any series.

Commit Message

weiyj_lk@163.com July 6, 2016, 12:23 p.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function iommu_domain_alloc() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
index ec12efb..2ed025d 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;
 
 		/*