Commit b4f8d242 authored by Colin Cross's avatar Colin Cross Committed by Greg Kroah-Hartman

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: default avatarColin Cross <ccross@android.com>
[jstultz: modified patch to apply to staging directory]
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e1cf3682
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment