[PATCH] staging: lustre: Fix return error code

Daniel Baluta daniel.baluta at gmail.com
Thu Oct 22 11:29:55 EEST 2015


On Thu, Oct 22, 2015 at 1:09 AM, Cristina Moraru
<cristina.moraru09 at gmail.com> wrote:
> Add function exit with the apropriate error code
> for conditional statement.

Commit message as it is now says what the code does. Anyhow, this
should be obvious from the code.

Instead, we should say why the patch is needed.

staging: lustre: Don't ignore error code

Error stored in rc was never reported, so directly return it here.

>
> Signed-off-by: Cristina Moraru <cristina.moraru09 at gmail.com>
> ---
>  drivers/staging/lustre/lnet/selftest/conctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
> index 8173966..556c837 100644
> --- a/drivers/staging/lustre/lnet/selftest/conctl.c
> +++ b/drivers/staging/lustre/lnet/selftest/conctl.c
> @@ -441,7 +441,7 @@ lst_group_info_ioctl(lstio_group_info_args_t *args)
>         if (args->lstio_grp_dentsp != NULL &&
>             (copy_to_user(args->lstio_grp_idxp, &index, sizeof(index)) ||
>              copy_to_user(args->lstio_grp_ndentp, &ndent, sizeof(ndent))))
> -               rc = -EFAULT;
> +               return -EFAULT;
>
>         return 0;
>  }
> --
> 1.9.1
>


More information about the firefly mailing list