From e1fcd840d7eadd603ce0fa65c98337dab0fe98ae Mon Sep 17 00:00:00 2001 From: kfx Date: Thu, 22 Dec 2011 20:16:41 +0800 Subject: [PATCH] gpu: ion: Take handle reference in ion_vma_open When ion_vma_open is called, a reference to the handle in the vma must be taken. Otherwise, if forking occurs, ion_vma_close will be called twice which will leave one of the calls with an invalid reference. --- drivers/gpu/ion/ion.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index 16dedc19b118..c5873151de48 100755 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -798,6 +798,7 @@ static void ion_vma_open(struct vm_area_struct *vma) vma->vm_private_data = NULL; return; } + 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), -- 2.34.1