Skip to content

Commit ee4f52a

Browse files
Zhang Changzhongkuba-moo
authored andcommitted
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: f8ed289 ("bridge: vlan: use br_vlan_(get|put)_master to deal with refcounts") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Zhang Changzhong <[email protected]> Acked-by: Nikolay Aleksandrov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b410f04 commit ee4f52a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/bridge/br_vlan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,10 @@ static int __vlan_add(struct net_bridge_vlan *v, u16 flags,
266266
}
267267

268268
masterv = br_vlan_get_master(br, v->vid, extack);
269-
if (!masterv)
269+
if (!masterv) {
270+
err = -ENOMEM;
270271
goto out_filt;
272+
}
271273
v->brvlan = masterv;
272274
if (br_opt_get(br, BROPT_VLAN_STATS_PER_PORT)) {
273275
v->stats = netdev_alloc_pcpu_stats(struct br_vlan_stats);

0 commit comments

Comments
 (0)