mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Nicholas Krause <xerofoify@gmail.com>
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
Subject: Re: [PATCH] namespace: Remove no longer needed goto label in the function, ops_init
Date: Thu, 28 May 2015 22:38:58 -0500	[thread overview]
Message-ID: <87y4k8cast.fsf@x220.int.ebiederm.org> (raw)
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")

Nicholas Krause <xerofoify@gmail.com> 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 <xerofoify@gmail.com>
> ---
>  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;
>  }

           reply	other threads:[~2015-05-29  3:44 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1432857028-5458-1-git-send-email-xerofoify@gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y4k8cast.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xerofoify@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®