[Bridge] [PATCH net v2 2/2] bridge: netlink: register netdevice before executing changelink

Stephen Hemminger stephen at networkplumber.org
Sat Apr 8 13:32:44 UTC 2017


On Sat, 8 Apr 2017 14:41:59 +0300
<idosch at 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


More information about the Bridge mailing list