summaryrefslogtreecommitdiff
path: root/net/8021q/vlan_netlink.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2022-02-09 03:19:55 -0500
committerDavid S. Miller <davem@davemloft.net>2022-02-09 13:33:39 +0000
commit37aa50c539bcbcc01767e515bd170787fcfc0f33 (patch)
tree71e002346f5bde8ea5c55d47ae22fd1aea0e145b /net/8021q/vlan_netlink.c
parentfeef318c855a361a1eccd880f33e88c460eb63b4 (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.c7
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;
}