ion: update ion drivers
authorkfx <kfx@rock-chips.com>
Wed, 9 May 2012 08:16:34 +0000 (16:16 +0800)
committerkfx <kfx@rock-chips.com>
Wed, 9 May 2012 08:16:34 +0000 (16:16 +0800)
drivers/gpu/ion/ion.c

index b76d61fe8921a2298e85b773d647909c9d75a2ae..1d1744570b84f2be0ba61cd0a0c49d40d3b9fe81 100755 (executable)
@@ -166,8 +166,8 @@ static void ion_buffer_destroy(struct kref *kref)
        struct ion_buffer *buffer = container_of(kref, struct ion_buffer, ref);
        struct ion_device *dev = buffer->dev;
 
-       buffer->heap->ops->free(buffer);
        mutex_lock(&dev->lock);
+       buffer->heap->ops->free(buffer);
        rb_erase(&buffer->node, &dev->buffers);
        mutex_unlock(&dev->lock);
        kfree(buffer);
@@ -815,6 +815,7 @@ static void ion_vma_close(struct vm_area_struct *vma)
        /* this indicates the client is gone, nothing to do here */
        if (!handle)
                return;
+        vma->vm_private_data = NULL;
        client = handle->client;
        pr_debug("%s: %d client_cnt %d handle_cnt %d alloc_cnt %d\n",
                 __func__, __LINE__,