gpu: ion: Change ION_IOC_ALLOC ioctl return value
ION_IOC_ALLOC may incorrectly return an error pointer
which could be 0 when an allocation fails. The ioctl call from user
space expects that the function succeeded when ioctl returns 0.
Change ION_IOC_ALLOC return value to -ENOMEM when the requested
buffer could not be allocated.
Change-Id: Id9d49ffa0eb8af5defc9635f40b45351b9dd8999
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index ae4dfcb..d436ef4 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -1355,7 +1355,7 @@
data.flags);
if (IS_ERR_OR_NULL(data.handle))
- return PTR_ERR(data.handle);
+ return -ENOMEM;
if (copy_to_user((void __user *)arg, &data, sizeof(data)))
return -EFAULT;