Re: [PATCH 7/7] mkfs: remove gotos in parse_defaults_file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 12, 2018 at 02:31:23PM -0500, Eric Sandeen wrote:
> There's no point to the gotos in parse_defaults_file; no cleanup
> etc that is normally facilitated by a goto, so just remove them.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
> ---
>  mkfs/config.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/mkfs/config.c b/mkfs/config.c
> index 173ab9a..f9ca78a 100644
> --- a/mkfs/config.c
> +++ b/mkfs/config.c
> @@ -636,17 +636,15 @@ parse_defaults_file(
>  
>  	fp = fdopen(fd, "r");
>  	if (!fp)
> -		goto out;
> +		return -1;
>  
>  	ret = parse_config_stream(dft, config_file, fp);
>  	if (ret) {
>  		fclose(fp);
> -		goto out;
> +		return -1;
>  	}

Separate patch, but don't we leak fp here?

Everything else seems ok to me,
Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

--D

>  
>  	printf(_("config-file=%s\n"), config_file);
>  
>  	return 0;
> -out:
> -	return -1;
>  }
> -- 
> 1.8.3.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux