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-next>] [day] [month] [year] [list]
Message-ID: <871vs3lgsy.wl%vmayatsk@redhat.com>
Date:	Wed, 08 Apr 2009 09:56:29 +0200
From:	Vitaly Mayatskikh <v.mayatskih@...il.com>
To:	"Kirill A. Shutemov" <kirill@...temov.name>
Cc:	Vitaly Mayatskikh <v.mayatskih@...il.com>,
	linux-kernel@...r.kernel.org, Pavel Emelianov <xemul@...nvz.org>
Subject: Re: [PATCH] Remove double initialization of retval in 	load_misc_binary()

At Wed, 8 Apr 2009 10:32:48 +0300, Kirill A. Shutemov wrote:

> Probably, better way is removing both 'retval = -ENOEXEC;'  and initialize it within definition.

Agree.

Signed-off-by: Vitaly Mayatskikh <v.mayatskih@...il.com>

diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index c4e8353..f10150f 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -109,14 +109,12 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
 	struct file * interp_file = NULL;
 	char iname[BINPRM_BUF_SIZE];
 	char *iname_addr = iname;
-	int retval;
+	int retval = -ENOEXEC;
 	int fd_binary = -1;
 
-	retval = -ENOEXEC;
 	if (!enabled)
 		goto _ret;
 
-	retval = -ENOEXEC;
 	if (bprm->recursion_depth > BINPRM_MAX_RECURSION)
 		goto _ret;
 

-- 
wbr, Vitaly
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ