aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/ion/ion.c
diff options
context:
space:
mode:
authorLaura Abbott <lauraa@codeaurora.org>2012-06-07 16:41:30 -0700
committerArve Hjønnevåg <arve@android.com>2013-04-29 14:42:55 -0700
commit4c119c2b0d47b64761363f616af4ac139f14c996 (patch)
treeb5a9d12cd37bf3a505bf1d4071eaac06d738661d /drivers/gpu/ion/ion.c
parent020f38e5d55c9ba00df124eaa51954da84d8c8df (diff)
gpu: ion: Loop on the handle count when destroying
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. Change-Id: I7dc5d6a86513fc5fa4e21110ceab434714ea2493 Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Diffstat (limited to 'drivers/gpu/ion/ion.c')
-rw-r--r--drivers/gpu/ion/ion.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index 36b723c201e..505e28504c8 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -232,7 +232,7 @@ static void ion_handle_destroy(struct kref *kref)
mutex_lock(&client->lock);
mutex_lock(&buffer->lock);
- while (buffer->kmap_cnt)
+ while (handle->kmap_cnt)
ion_handle_kmap_put(handle);
mutex_unlock(&buffer->lock);