lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <o2ijjlbcicrrfflp54o53sj5v6morqedtkkzizhhyvl6cqvezw@yl7hx3naojcn>
Date: Sat, 13 Sep 2025 15:11:08 +0200
From: Klara Modin <klarasmodin@...il.com>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Alexander Viro <viro@...iv.linux.org.uk>, 
	Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>, linux-fsdevel@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] initrd: Remove unnecessary goto label 'successful_load'

Hi,

On 2025-09-13 14:15:14 +0200, Thorsten Blum wrote:
> The goto label 'successful_load' isn't really necessary. Set 'res = 1'
> immediately and let 'goto done' handle the rest.
> 
> No functional changes.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> ---
>  init/do_mounts_rd.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
> index ac021ae6e6fa..97ddcdaba893 100644
> --- a/init/do_mounts_rd.c
> +++ b/init/do_mounts_rd.c
> @@ -210,7 +210,7 @@ int __init rd_load_image(char *from)
>  

>  	if (nblocks == 0) {
>  		if (crd_load(decompressor) == 0)
> -			goto successful_load;
> +			res = 1; /* load successful */
>  		goto done;
>  	}

This is now the only place where res will be set to 1.

>  
> @@ -264,8 +264,6 @@ int __init rd_load_image(char *from)
>  	}
>  	pr_cont("done.\n");
>  

> -successful_load:
> -	res = 1;

This does not seem correct? After this patch res is not updated to 1 anymore
if execution reaches here without taking another goto, i.e. the return
value is changed by this patch.

Regards,
Klara Modin

>  done:
>  	fput(in_file);
>  noclose_input:
> -- 
> 2.51.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ