diff options
author | Xin Long <lucien.xin@gmail.com> | 2022-02-09 03:19:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-02-09 13:33:39 +0000 |
commit | 37aa50c539bcbcc01767e515bd170787fcfc0f33 (patch) | |
tree | 71e002346f5bde8ea5c55d47ae22fd1aea0e145b /net/8021q/vlan_netlink.c | |
parent | feef318c855a361a1eccd880f33e88c460eb63b4 (diff) |
vlan: introduce vlan_dev_free_egress_priority
This patch is to introduce vlan_dev_free_egress_priority() to
free egress priority for vlan dev, and keep vlan_dev_uninit()
static as .ndo_uninit. It makes the code more clear and safer
when adding new code in vlan_dev_uninit() in the future.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan_netlink.c')
-rw-r--r-- | net/8021q/vlan_netlink.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c index 0db85aeb119b..53b1955b027f 100644 --- a/net/8021q/vlan_netlink.c +++ b/net/8021q/vlan_netlink.c @@ -183,10 +183,11 @@ static int vlan_newlink(struct net *src_net, struct net_device *dev, return -EINVAL; err = vlan_changelink(dev, tb, data, extack); - if (!err) - err = register_vlan_dev(dev, extack); if (err) - vlan_dev_uninit(dev); + return err; + err = register_vlan_dev(dev, extack); + if (err) + vlan_dev_free_egress_priority(dev); return err; } |