Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bridge: Fix error path in nbp_vlan_init

Fix error path order in nbp_vlan_init, so if switchdev_port_attr_set
call failes, the vlan_hash wouldn't be destroyed before inited.

Fixes: efa5356b0d97 ("bridge: per vlan dst_metadata netlink support")
CC: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yotam Gigi and committed by
David S. Miller
df2c4334 3b45a410

+1 -1
+1 -1
net/bridge/br_vlan.c
··· 997 997 RCU_INIT_POINTER(p->vlgrp, NULL); 998 998 synchronize_rcu(); 999 999 vlan_tunnel_deinit(vg); 1000 - err_vlan_enabled: 1001 1000 err_tunnel_init: 1002 1001 rhashtable_destroy(&vg->vlan_hash); 1003 1002 err_rhtbl: 1003 + err_vlan_enabled: 1004 1004 kfree(vg); 1005 1005 1006 1006 goto out;