Skip to content

Commit

Permalink
drm/armada: fix gem object free after failed prime import
Browse files Browse the repository at this point in the history
Fix the gem object freeing after a partial import of a dma buffer,
eg, one which has been imported, but not mapped.  This was provoking
a warning from the dma_buf code.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Jul 15, 2015
1 parent 41dbb2d commit 0481c8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/drm/armada/armada_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ void armada_gem_free_object(struct drm_gem_object *obj)

if (dobj->obj.import_attach) {
/* We only ever display imported data */
dma_buf_unmap_attachment(dobj->obj.import_attach, dobj->sgt,
DMA_TO_DEVICE);
if (dobj->sgt)
dma_buf_unmap_attachment(dobj->obj.import_attach,
dobj->sgt, DMA_TO_DEVICE);
drm_prime_gem_destroy(&dobj->obj, NULL);
}

Expand Down

0 comments on commit 0481c8c

Please sign in to comment.