diff mbox

[RFC,4/4] DRM: Armada: prime refcounting bug fix

Message ID E1VpoQa-0000qs-6g@rmk-PC.arm.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Russell King Dec. 9, 2013, 12:10 a.m. UTC
Commit 011c2282c74d changed the way refcounting on imported dma_bufs
works, and this hadn't been spotted while forward-porting Armada.
Reflect the changes in that commit into the Armada driver.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/gpu/drm/armada/armada_gem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Thierry Reding Dec. 10, 2013, 4 p.m. UTC | #1
On Mon, Dec 09, 2013 at 12:10:24AM +0000, Russell King wrote:
> Commit 011c2282c74d changed the way refcounting on imported dma_bufs
> works, and this hadn't been spotted while forward-porting Armada.
> Reflect the changes in that commit into the Armada driver.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>  drivers/gpu/drm/armada/armada_gem.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Reviewed-by: Thierry Reding <treding@nvidia.com>
diff mbox

Patch

diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
index adc7c2da75bb..887816f43476 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -558,7 +558,6 @@  armada_gem_prime_import(struct drm_device *dev, struct dma_buf *buf)
 			 * refcount on the gem object itself.
 			 */
 			drm_gem_object_reference(obj);
-			dma_buf_put(buf);
 			return obj;
 		}
 	}
@@ -574,6 +573,7 @@  armada_gem_prime_import(struct drm_device *dev, struct dma_buf *buf)
 	}
 
 	dobj->obj.import_attach = attach;
+	get_dma_buf(buf);
 
 	/*
 	 * Don't call dma_buf_map_attachment() here - it maps the