[lustre-devel] [PATCH 17/25] staging: lustre: libcfs: rename goto label in cfs_cpt_table_print

Dan Carpenter dan.carpenter at oracle.com
Tue Apr 17 00:34:42 PDT 2018


> diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
> index ae5ff58..435ee8e 100644
> --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
> +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
> @@ -161,20 +161,20 @@ int cfs_cpt_table_print(struct cfs_cpt_table *cptab, char *buf, int len)
>  
>  	for (i = 0; i < cptab->ctb_nparts; i++) {
>  		if (len <= 0)
> -			goto out;
> +			goto err;
>  
>  		rc = snprintf(tmp, len, "%d\t:", i);
>  		len -= rc;
>  
>  		if (len <= 0)
> -			goto out;
> +			goto err;

Labels should say what the goto does.  In this case, it's a do-nothing
goto with a "forgot to set the error code" bug.

regards,
dan carpenter



More information about the lustre-devel mailing list