diff options
author | Colin Cross <ccross@android.com> | 2013-12-13 14:24:52 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-14 08:57:18 -0800 |
commit | b4f8d242c6fb5e631ba861c1a6024ae14b02f5a8 (patch) | |
tree | 6115fcd13b17a6066058b26c6f26c32f3626cf85 /drivers | |
parent | e1cf36823407751d1ad1168bc718cf5a0ac5dbf4 (diff) |
ion: don't use id 0 for handle cookie
ion userspace clients think that the cookie is a pointer, so they
use NULL to check if the handle has been initialized. Set the first
id number to 1.
Signed-off-by: Colin Cross <ccross@android.com>
[jstultz: modified patch to apply to staging directory]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/android/ion/ion.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index ef0b2d704a7b..273ec3a51fff 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -424,7 +424,7 @@ static int ion_handle_add(struct ion_client *client, struct ion_handle *handle) rc = idr_pre_get(&client->idr, GFP_KERNEL); if (!rc) return -ENOMEM; - rc = idr_get_new(&client->idr, handle, &id); + rc = idr_get_new_above(&client->idr, handle, 1, &id); handle->id = id; } while (rc == -EAGAIN); |