diff mbox

[RFC,014/111] staging: etnaviv: fix cleanup of imported dmabufs

Message ID 1427988653-754-15-git-send-email-l.stach@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Stach April 2, 2015, 3:29 p.m. UTC
From: Russell King <rmk+kernel@arm.linux.org.uk>

We need to call drm_prime_gem_destroy() to properly clean up imported
dmabufs when their associated GEM object is deleted, otherwise we drop
a refcount on them, preventing them from being cleaned up.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/staging/etnaviv/etnaviv_gem.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/drivers/staging/etnaviv/etnaviv_gem.c b/drivers/staging/etnaviv/etnaviv_gem.c
index 42149a2b7404..f98d5ee43853 100644
--- a/drivers/staging/etnaviv/etnaviv_gem.c
+++ b/drivers/staging/etnaviv/etnaviv_gem.c
@@ -519,6 +519,7 @@  static void etnaviv_free_obj(struct drm_gem_object *obj)
 		if (etnaviv_obj->pages)
 			drm_free_large(etnaviv_obj->pages);
 
+		drm_prime_gem_destroy(obj, etnaviv_obj->sgt);
 	} else {
 		if (etnaviv_obj->vaddr)
 			vunmap(etnaviv_obj->vaddr);