diff mbox

drm/nouveau/platform: checking for IS_ERR() instead of NULL

Message ID 20150421092507.GB12098@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter April 21, 2015, 9:25 a.m. UTC
iommu_domain_alloc() returns NULL on error, it doesn't return error
pointers.

Fixes: 58fd9375c2c5 ('drm/nouveau/platform: probe IOMMU if present')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Thierry Reding April 21, 2015, 9:36 a.m. UTC | #1
On Tue, Apr 21, 2015 at 12:25:07PM +0300, Dan Carpenter wrote:
> iommu_domain_alloc() returns NULL on error, it doesn't return error
> pointers.
> 
> Fixes: 58fd9375c2c5 ('drm/nouveau/platform: probe IOMMU if present')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Indeed:

Reviewed-by: Thierry Reding <treding@nvidia.com>
Alexandre Courbot April 21, 2015, 9:43 a.m. UTC | #2
On 04/21/2015 06:25 PM, Dan Carpenter wrote:
> iommu_domain_alloc() returns NULL on error, it doesn't return error
> pointers.

Oops, that's right.

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

Patch

diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm/nouveau/nouveau_platform.c
index 775277f..4fbd35d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_platform.c
+++ b/drivers/gpu/drm/nouveau/nouveau_platform.c
@@ -102,7 +102,7 @@  static void nouveau_platform_probe_iommu(struct device *dev,
 
 	if (iommu_present(&platform_bus_type)) {
 		gpu->iommu.domain = iommu_domain_alloc(&platform_bus_type);
-		if (IS_ERR(gpu->iommu.domain))
+		if (!gpu->iommu.domain)
 			goto error;
 
 		/*