netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: <idosch@mellanox.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>,
	<bridge@lists.linux-foundation.org>, <peter@svinota.eu>,
	<cera@cera.cz>, <mlxsw@mellanox.com>,
	<nikolay@cumulusnetworks.com>
Subject: Re: [PATCH net v2 2/2] bridge: netlink: register netdevice before executing changelink
Date: Sat, 8 Apr 2017 09:32:44 -0400	[thread overview]
Message-ID: <20170408093244.593a8624@plumbers-lap.home.lan> (raw)
In-Reply-To: <20170408114159.12722-3-idosch@mellanox.com>

On Sat, 8 Apr 2017 14:41:59 +0300
<idosch@mellanox.com> wrote:

> +	err = br_changelink(dev, tb, data);
> +	if (err)
> +		goto unregister;
> +
> +	return 0;
> +
> +unregister:
> +	unregister_netdevice(dev);
> +	return err;
>  }

Why use a goto? just do:
	err = br_changelink(dev, tb, data);
	if (err)
		unregister_netdevice(dev)
	return err;
}


The goto looks ugly

      reply	other threads:[~2017-04-08 13:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-08 11:41 [PATCH net v2 0/2] bridge: Fix kernel oops during bridge creation idosch
2017-04-08 11:41 ` [PATCH net v2 1/2] bridge: implement missing ndo_uninit() idosch
2017-04-08 13:30   ` Stephen Hemminger
2017-04-08 13:49     ` Ido Schimmel
2017-04-08 14:05       ` Nikolay Aleksandrov
2017-04-08 14:14         ` Stephen Hemminger
2017-04-08 14:14           ` Ivan Vecera
2017-04-08 14:23           ` Ivan Vecera
2017-04-08 11:41 ` [PATCH net v2 2/2] bridge: netlink: register netdevice before executing changelink idosch
2017-04-08 13:32   ` Stephen Hemminger [this message]

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=20170408093244.593a8624@plumbers-lap.home.lan \
    --to=stephen@networkplumber.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=cera@cera.cz \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=peter@svinota.eu \
    /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;
as well as URLs for NNTP newsgroup(s).