Toshiaki Makita
2017-Oct-26 10:16 UTC
[Bridge] [PATCH net-next v4 2/2] bridge: vlan: signal if anything changed on vlan add
On 2017/10/26 7:52, Nikolay Aleksandrov wrote: ...> @@ -559,6 +574,7 @@ int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags) > > ASSERT_RTNL(); > > + *changed = false; > vg = br_vlan_group(br); > vlan = br_vlan_find(vg, vid); > if (vlan) { > @@ -576,9 +592,12 @@ int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags) > refcount_inc(&vlan->refcnt); > vlan->flags |= BRIDGE_VLAN_INFO_BRENTRY; > vg->num_vlans++; > + *changed = true; > } > - __vlan_add_flags(vlan, flags); > - return 0; > + if (__vlan_add_flags(vlan, flags)) > + *changed = true; > + > + return ret;"ret" isn't always initialized here, is it? Toshiaki Makita
Nikolay Aleksandrov
2017-Oct-26 11:02 UTC
[Bridge] [PATCH net-next v4 2/2] bridge: vlan: signal if anything changed on vlan add
On 26/10/17 13:16, Toshiaki Makita wrote:> On 2017/10/26 7:52, Nikolay Aleksandrov wrote: > ... >> @@ -559,6 +574,7 @@ int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags) >> >> ASSERT_RTNL(); >> >> + *changed = false; >> vg = br_vlan_group(br); >> vlan = br_vlan_find(vg, vid); >> if (vlan) { >> @@ -576,9 +592,12 @@ int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags) >> refcount_inc(&vlan->refcnt); >> vlan->flags |= BRIDGE_VLAN_INFO_BRENTRY; >> vg->num_vlans++; >> + *changed = true; >> } >> - __vlan_add_flags(vlan, flags); >> - return 0; >> + if (__vlan_add_flags(vlan, flags)) >> + *changed = true; >> + >> + return ret; > > "ret" isn't always initialized here, is it? > > > Toshiaki MakitaOh, good catch! Right you are, weird that there was no warning even with W=1 as I always check that before sending a set. Thanks, Nik