mirror of https://gitee.com/openkylin/linux.git
net: bridge: vlan: fix error return code in __vlan_add()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: f8ed289fab
("bridge: vlan: use br_vlan_(get|put)_master to deal with refcounts")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Link: https://lore.kernel.org/r/1607071737-33875-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
b410f04eb5
commit
ee4f52a8de
|
@ -266,8 +266,10 @@ static int __vlan_add(struct net_bridge_vlan *v, u16 flags,
|
|||
}
|
||||
|
||||
masterv = br_vlan_get_master(br, v->vid, extack);
|
||||
if (!masterv)
|
||||
if (!masterv) {
|
||||
err = -ENOMEM;
|
||||
goto out_filt;
|
||||
}
|
||||
v->brvlan = masterv;
|
||||
if (br_opt_get(br, BROPT_VLAN_STATS_PER_PORT)) {
|
||||
v->stats = netdev_alloc_pcpu_stats(struct br_vlan_stats);
|
||||
|
|
Loading…
Reference in New Issue