Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763084AbZDHH4v (ORCPT ); Wed, 8 Apr 2009 03:56:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757163AbZDHH4b (ORCPT ); Wed, 8 Apr 2009 03:56:31 -0400 Received: from fg-out-1718.google.com ([72.14.220.154]:48965 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761976AbZDHH4a (ORCPT ); Wed, 8 Apr 2009 03:56:30 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:message-id:from:to:cc:subject:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=jp6D63vKEbS7hlmT9b8cSeZA2e7Y4xOd9f4JEOwvUWzNTMHC0+RYPg8CJL18RBGsmh ceU3ZbiSvsmAajlcUJquSOtD/3ICEIUEvownzILmMYHEMBH9eIG94sFqMkwG20azhGTe aqtd+ljSJGLLsBCEy+uy9ZcVkUC5YTlXmGd80= Date: Wed, 08 Apr 2009 09:56:29 +0200 Message-ID: <871vs3lgsy.wl%vmayatsk@redhat.com> From: Vitaly Mayatskikh To: "Kirill A. Shutemov" Cc: Vitaly Mayatskikh , linux-kernel@vger.kernel.org, Pavel Emelianov Subject: Re: [PATCH] Remove double initialization of retval in load_misc_binary() In-Reply-To: References: <87ljqcmsjs.wl%vmayatsk@redhat.com> User-Agent: Wanderlust/2.15.6 (Almost Unreal) Emacs/22.3 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1014 Lines: 36 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 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/