From: kfx Date: Thu, 22 Dec 2011 12:16:41 +0000 (+0800) Subject: gpu: ion: Take handle reference in ion_vma_open X-Git-Tag: firefly_0821_release~9697 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e1fcd840d7eadd603ce0fa65c98337dab0fe98ae;p=firefly-linux-kernel-4.4.55.git 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. --- 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),