From: Laura Abbott Date: Thu, 7 Jun 2012 23:41:30 +0000 (-0700) Subject: gpu: ion: Loop on the handle count when destroying X-Git-Tag: firefly_0821_release~4090^2~724 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=75d890577808925f997e4a985f78b64e9f4a26c3;p=firefly-linux-kernel-4.4.55.git 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 --- 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);