RE: [RFC] ion:change ion_cma_allocate return error value

From: Wang, Yalin
Date: Wed Jan 28 2015 - 22:39:43 EST


> -----Original Message-----
> From: 'gregkh@xxxxxxxxxxxxxxxxxxx' [mailto:gregkh@xxxxxxxxxxxxxxxxxxx]
> Sent: Thursday, January 29, 2015 2:45 AM
> To: Wang, Yalin
> Cc: 'tranmanphong@xxxxxxxxx'; 'fabio.estevam@xxxxxxxxxxxxx';
> 'prime.zeng@xxxxxxxxxx'; 'devel@xxxxxxxxxxxxxxxxxxxx'; 'linux-
> kernel@xxxxxxxxxxxxxxx'; Gao, Neil
> Subject: Re: [RFC] ion:change ion_cma_allocate return error value
>
> On Tue, Jan 27, 2015 at 02:04:21PM +0800, Wang, Yalin wrote:
> > This patch change the error return value from -1 to -ENOMEM, so that
> > userspace can get the correct errno, otherwise,
> > -1 will be -EPERM, userspace will print permission deny for allocation
> > failure.
> >
> > Signed-off-by: Yalin Wang <yalin.wang@xxxxxxxxxxxxxx>
> > ---
> > drivers/staging/android/ion/ion_cma_heap.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
>
> Don't you also need to now change userspace code to properly handle these
> errors?
>
No, because userspace use strerror() to print errno,
It will print correct error string depending on kernel return
Errno.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/