diff options
author | Fang Hui <b31070@freescale.com> | 2014-07-16 16:40:46 +0800 |
---|---|---|
committer | Fang Hui <b31070@freescale.com> | 2014-07-17 09:59:25 +0800 |
commit | ce936d871e50eda7271f7829e275b2636fee3de3 (patch) | |
tree | ea484079f3ba043facc122bda4abfd0c240d3f81 /drivers | |
parent | 1eb5ff416c4025b703fc0693251f639da11f7e16 (diff) |
ENGR00321693 - [Android_MX6Q_SD] Camera:Preview hung after taking a picture. 2%
in ION_IOC_PHYS, should call ion_handle_put after ion_handle_get_by_id,
or the ref count will added by 1. So when ion free, will not really free.
Signed-off-by: Fang Hui <b31070@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/android/ion/ion.c | 7 | ||||
-rw-r--r-- | drivers/staging/android/ion/mxc/mxc_ion.c | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 988e2bec1aaa..7a2097b9dbc9 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -3,6 +3,7 @@ * drivers/gpu/ion/ion.c * * Copyright (C) 2011 Google, Inc. + * Copyright (C) 2014 Freescale Semiconductor, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -400,6 +401,12 @@ static int ion_handle_put(struct ion_handle *handle) return ret; } +/* for used in mxc_ion.c */ +int ion_handle_put_wrap(struct ion_handle *handle) +{ + return ion_handle_put(handle); +} + static struct ion_handle *ion_handle_lookup(struct ion_client *client, struct ion_buffer *buffer) { diff --git a/drivers/staging/android/ion/mxc/mxc_ion.c b/drivers/staging/android/ion/mxc/mxc_ion.c index b400a6dce018..a8105a8665f8 100644 --- a/drivers/staging/android/ion/mxc/mxc_ion.c +++ b/drivers/staging/android/ion/mxc/mxc_ion.c @@ -31,6 +31,7 @@ static int num_heaps = 1; static struct ion_heap **heaps; static int cacheable; +extern int ion_handle_put_wrap(struct ion_handle *handle); extern struct ion_handle *ion_handle_get_by_id(struct ion_client *client, int id); @@ -93,6 +94,8 @@ static long mxc_custom_ioctl(struct ion_client *client, return PTR_ERR(handle); valid = ion_phys(client, handle, &phys, &len); + ion_handle_put_wrap(handle); + if (valid) return -1; data.phys = phys; |