[lkml]   [2013]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 014/115] gpu: ion: Loop on the handle count when destroying
From: Laura Abbott <>

When destroying a handle, all kernel mappings to that handle
should be destroyed. Other handles may still have references
and valid mappings to the buffer underneath which should not
be destroyed. Loop on the handle reference count, not the buffer
reference count to get rid of all kernel mappings for the handle.

Signed-off-by: Laura Abbott <>
[jstultz: modified patch to apply to staging directory]
Signed-off-by: John Stultz <>
drivers/staging/android/ion/ion.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index ddfe49a..dc7174d 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -232,7 +232,7 @@ static void ion_handle_destroy(struct kref *kref)

- while (buffer->kmap_cnt)
+ while (handle->kmap_cnt)


 \ /
  Last update: 2013-12-14 00:21    [W:0.250 / U:1.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site