Commit 1266cdb1 authored by Michel Thierry's avatar Michel Thierry Committed by Daniel Vetter

drm/i915: Fix i915_dma_map_single positive error code

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

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

v2: Return negative error code and renamed commit title. (Dan)
v3: Missing reported-by tag (Daniel)
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarMichel Thierry <michel.thierry@intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent fdc454c1
...@@ -311,7 +311,10 @@ static inline int i915_dma_map_page_single(struct page *page, ...@@ -311,7 +311,10 @@ static inline int i915_dma_map_page_single(struct page *page,
struct device *device = &dev->pdev->dev; struct device *device = &dev->pdev->dev;
*daddr = dma_map_page(device, page, 0, 4096, PCI_DMA_BIDIRECTIONAL); *daddr = dma_map_page(device, page, 0, 4096, PCI_DMA_BIDIRECTIONAL);
return dma_mapping_error(device, *daddr); if (dma_mapping_error(device, *daddr))
return -ENOMEM;
return 0;
} }
static void unmap_and_free_pt(struct i915_page_table_entry *pt, static void unmap_and_free_pt(struct i915_page_table_entry *pt,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment