[PATCH -next] binder: change error code from postive to negative in binder_transaction

Martijn Coenen maco at android.com
Tue Oct 27 08:29:59 UTC 2020


Thanks!

On Mon, Oct 26, 2020 at 11:52 AM Zhang Qilong <zhangqilong3 at huawei.com> wrote:
>
> Depending on the context, the error return value
> here (extra_buffers_size < added_size) should be
> negative.
>
> Signed-off-by: Zhang Qilong <zhangqilong3 at huawei.com>
Acked-by: Martijn Coenen <maco at android.com>

> ---
>  drivers/android/binder.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> index b5117576792b..8bbfb9124fa2 100644
> --- a/drivers/android/binder.c
> +++ b/drivers/android/binder.c
> @@ -3103,7 +3103,7 @@ static void binder_transaction(struct binder_proc *proc,
>                 if (extra_buffers_size < added_size) {
>                         /* integer overflow of extra_buffers_size */
>                         return_error = BR_FAILED_REPLY;
> -                       return_error_param = EINVAL;
> +                       return_error_param = -EINVAL;
>                         return_error_line = __LINE__;
>                         goto err_bad_extra_size;
>                 }
> --
> 2.17.1
>


More information about the devel mailing list