summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRebecca Schultz Zavin <rebecca@android.com>2011-07-06 18:07:01 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:38:46 -0800
commite4326aff4368886f28f88a3776632d0bdd4fffef (patch)
treed6dffa03b2f0496f93eaef4da7aa2ca3910871bd /drivers/gpu
parent74e8c2f4cd74e0aec29704db573929eabbd93196 (diff)
gpu: ion: Fix bug in ion client destroy
ion_client_destroy kernel api should only delete the client if it's refcount has gone to zero. Change-Id: Iaa662bd82d67279a9807e01f9a24aebe3d21c17d Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/ion/ion.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index 1a63ebff5eee..f11a566f9a77 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -705,8 +705,9 @@ struct ion_client *ion_client_create(struct ion_device *dev,
return client;
}
-void ion_client_destroy(struct ion_client *client)
+static void _ion_client_destroy(struct kref *kref)
{
+ struct ion_client *client = container_of(kref, struct ion_client, ref);
struct ion_device *dev = client->dev;
struct rb_node *n;
@@ -729,12 +730,6 @@ void ion_client_destroy(struct ion_client *client)
kfree(client);
}
-static void _ion_client_destroy(struct kref *kref)
-{
- struct ion_client *client = container_of(kref, struct ion_client, ref);
- ion_client_destroy(client);
-}
-
static void ion_client_get(struct ion_client *client)
{
kref_get(&client->ref);
@@ -745,6 +740,11 @@ static int ion_client_put(struct ion_client *client)
return kref_put(&client->ref, _ion_client_destroy);
}
+void ion_client_destroy(struct ion_client *client)
+{
+ ion_client_put(client);
+}
+
static int ion_share_release(struct inode *inode, struct file* file)
{
struct ion_buffer *buffer = file->private_data;