From 75d890577808925f997e4a985f78b64e9f4a26c3 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Thu, 7 Jun 2012 16:41:30 -0700 Subject: [PATCH] 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 --- drivers/gpu/ion/ion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index 36b723c201e9..505e28504c83 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); -- 2.34.1