[Intel-gfx] [PATCH 2/5] drm/i915: i915_dma_map_single returns positive error codes

Michel Thierry michel.thierry at intel.com
Tue Mar 24 08:46:20 PDT 2015


i915_dma_map_single relies on dma_mapping_error, which returns positive
error codes. Found by static checker.

Introduced by commit 678d96fbb3b5995a2fdff2bca5e1ab4a40b7e968
("drm/i915: Track GEN6 page table usage").

Cc: Dan Carpenter <dan.carpenter at oracle.com>
Cc: Mika Kuoppala <mika.kuoppala at intel.com>
Signed-off-by: Michel Thierry <michel.thierry at intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 645c363..79ade6f 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -348,7 +348,7 @@ static struct i915_page_table_entry *alloc_pt_single(struct drm_device *dev)
 		goto fail_page;
 
 	ret = i915_dma_map_single(pt, dev);
-	if (ret)
+	if (ret != 0)
 		goto fail_dma;
 
 	return pt;
-- 
2.1.1



More information about the Intel-gfx mailing list