summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorKrishna Reddy <vdumpa@nvidia.com>2011-12-29 11:06:36 -0800
committerKrishna Reddy <vdumpa@nvidia.com>2011-12-29 11:36:57 -0800
commitac60f9ad0b81bb277ae4633095616fbd871e374f (patch)
tree8abc3fc31826feb640755c9637149891966b91f4 /drivers/gpu
parent9515f031fa33491ca7c386b5ce1ff80226fecd7f (diff)
gpu: ion: Fix ion handle and buffer ref counting issue.
Handle and buffer are not ref counted correct during fork from a process, which has mmap'ed ion memory. Change-Id: Ida98f4639f29fef8397abd07bbf317c1baa0130e Signed-off-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-on: http://git-master/r/72643 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/ion/ion.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index 37b23af0550b..5bec864f1f42 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -796,6 +796,8 @@ static void ion_vma_open(struct vm_area_struct *vma)
vma->vm_private_data = NULL;
return;
}
+ ion_buffer_get(buffer);
+ ion_handle_get(handle);
pr_debug("%s: %d client_cnt %d handle_cnt %d alloc_cnt %d\n",
__func__, __LINE__,
atomic_read(&client->ref.refcount),
@@ -821,6 +823,7 @@ static void ion_vma_close(struct vm_area_struct *vma)
atomic_read(&buffer->ref.refcount));
ion_handle_put(handle);
ion_client_put(client);
+ ion_buffer_put(buffer);
pr_debug("%s: %d client_cnt %d handle_cnt %d alloc_cnt %d\n",
__func__, __LINE__,
atomic_read(&client->ref.refcount),
@@ -866,6 +869,7 @@ static int ion_share_mmap(struct file *file, struct vm_area_struct *vma)
ret = -EINVAL;
goto err;
}
+ ion_buffer_get(buffer);
if (!handle->buffer->heap->ops->map_user) {
pr_err("%s: this heap does not define a method for mapping "