From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932448AbbE2DoN (ORCPT ); Thu, 28 May 2015 23:44:13 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:57262 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932236AbbE2DoC (ORCPT ); Thu, 28 May 2015 23:44:02 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Nicholas Krause Cc: davem@davemloft.net, nicolas.dichtel@6wind.com, viro@zeniv.linux.org.uk, edumazet@google.com, yongjun_wei@trendmicro.com.cn, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1432857028-5458-1-git-send-email-xerofoify@gmail.com> Date: Thu, 28 May 2015 22:38:58 -0500 In-Reply-To: <1432857028-5458-1-git-send-email-xerofoify@gmail.com> (Nicholas Krause's message of "Thu, 28 May 2015 19:50:28 -0400") Message-ID: <87y4k8cast.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX19CuX4hO/tJS/tb2AOyoYul9SWzSQe9O7A= X-SA-Exim-Connect-IP: 67.3.205.90 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4999] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.1 XMSolicitRefs_0 Weightloss drug * 1.0 T_XMDrugObfuBody_12 obfuscated drug references * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Nicholas Krause X-Spam-Relay-Country: X-Spam-Timing: total 1385 ms - load_scoreonly_sql: 0.10 (0.0%), signal_user_changed: 4.5 (0.3%), b_tie_ro: 3.1 (0.2%), parse: 0.95 (0.1%), extract_message_metadata: 3.8 (0.3%), get_uri_detail_list: 1.67 (0.1%), tests_pri_-1000: 3.6 (0.3%), tests_pri_-950: 1.31 (0.1%), tests_pri_-900: 1.21 (0.1%), tests_pri_-400: 18 (1.3%), check_bayes: 17 (1.2%), b_tokenize: 5 (0.4%), b_tok_get_all: 5 (0.4%), b_comp_prob: 1.79 (0.1%), b_tok_touch_all: 2.7 (0.2%), b_finish: 0.66 (0.0%), tests_pri_0: 1336 (96.4%), tests_pri_500: 5 (0.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] namespace: Remove no longer needed goto label in the function, ops_init X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nicholas Krause writes: > This removes the no longer needed goto label, cleanup in the > function ops_init due to kfree being NULL pointer safe and > therefore no need to avoid calling it the call to kzalloc > fails inside this particular function. Your proposed change pessimizes the error path without a description of why that would be a benefit. Further the subject on this patch is incorrect. You don't remove any gotos. So I don't like this change as it. The description is wrong and the change provides little to no real world benefit. Eric > Signed-off-by: Nicholas Krause > --- > net/core/net_namespace.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c > index 572af00..e8b5568 100644 > --- a/net/core/net_namespace.c > +++ b/net/core/net_namespace.c > @@ -102,7 +102,7 @@ static int ops_init(const struct pernet_operations *ops, struct net *net) > > err = net_assign_generic(net, *ops->id, data); > if (err) > - goto cleanup; > + goto out; > } > err = 0; > if (ops->init) > @@ -110,10 +110,8 @@ static int ops_init(const struct pernet_operations *ops, struct net *net) > if (!err) > return 0; > > -cleanup: > - kfree(data); > - > out: > + kfree(data); > return err; > }