Message ID | 1386973529-4884-87-git-send-email-john.stultz@linaro.org |
---|---|
State | Accepted |
Headers | show |
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index cf9fc78..2e7be70 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -485,11 +485,11 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len, * request of the caller allocate from it. Repeat until allocate has * succeeded or all heaps have been tried */ - if (WARN_ON(!len)) - return ERR_PTR(-EINVAL); - len = PAGE_ALIGN(len); + if (!len) + return ERR_PTR(-EINVAL); + down_read(&dev->lock); plist_for_each_entry(heap, &dev->heaps, node) { /* if the caller didn't specify this heap id */