rk: ion: fixed bug for ION_IOC_GET_PHYS
authorCMY <cmy@rock-chips.com>
Mon, 24 Feb 2014 09:51:23 +0000 (17:51 +0800)
committerCMY <cmy@rock-chips.com>
Mon, 24 Feb 2014 09:53:08 +0000 (17:53 +0800)
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/rockchip/rockchip_ion.c

index 468146dc87fb70917e074fa80ae2615620ea01cd..534bed6078022ae507cc85c4526886b9173be19a 100755 (executable)
@@ -388,7 +388,7 @@ static void ion_handle_get(struct ion_handle *handle)
        kref_get(&handle->ref);
 }
 
-static int ion_handle_put(struct ion_handle *handle)
+int ion_handle_put(struct ion_handle *handle)
 {
        struct ion_client *client = handle->client;
        int ret;
index a91dfe6911cdfb2f4924707b0adc386f517d923c..553134b83a9c5d85353f6d972e38c2d653977326 100755 (executable)
@@ -39,6 +39,7 @@ struct ion_heap_desc {
 
 extern struct ion_handle *ion_handle_get_by_id(struct ion_client *client,
                                                int id);
+extern int ion_handle_put(struct ion_handle *handle);
 
 static struct ion_heap_desc ion_heap_meta[] = {
        {
@@ -186,6 +187,7 @@ static long rockchip_custom_ioctl (struct ion_client *client, unsigned int cmd,
 
                ret = ion_phys(client, handle, &data.phys, (size_t *)&data.size);
                pr_info("ret=%d, phys=0x%X\n", ret, data.phys);
+               ion_handle_put(handle);
                if(ret < 0)
                        return ret;
                if (copy_to_user((void __user *)arg, &data, sizeof(struct ion_phys_data)))