Skip to contentSkip to conversation

net: bridge: Fix missing return assignment from br_vlan_replay_one call

PATCH Applied Colin King 4 participants 4 messages Mar 24, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 net: bridge: Fix missing return assignment from br_vlan_replay_one call

From: Colin Ian King <[email protected]>

The call to br_vlan_replay_one is returning an error return value but this is not being assigned to err and the following check on err is currently always false because err was initialized to zero. Fix this by assigning err.

Addresses-Coverity: ("'Constant' variable guards dead code")

Fixes 22f67cdfae6a ("net: bridge: add helper to replay VLANs installed on port")
---
 net/bridge/br_vlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_vlan.c +1 -1
index ca8daccff217..7422691230b1 100644
@@ -1815,7 +1815,7 @@ int br_vlan_replay(struct net_device *br_dev, struct net_device *dev,
 		if (!br_vlan_should_use(v))
 			continue;
 
-		br_vlan_replay_one(nb, dev, &vlan, extack);
+		err = br_vlan_replay_one(nb, dev, &vlan, extack);
 		if (err)
 			return err;
 	}
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Colin King

From: Colin Ian King <[email protected]>

The call to br_vlan_replay_one is returning an error return value but this is not being assigned to err and the following check on err is currently always false because err was initialized to zero. Fix this by assigning err.

Addresses-Coverity: ("'Constant' variable guards dead code")

Fixes 22f67cdfae6a ("net: bridge: add helper to replay VLANs installed on port")

---

Acked-by on v1 1/1
#2 lore raw
In reply to Colin King
Quoted 20 lines · Colin King

From: Colin Ian King <[email protected]>

The call to br_vlan_replay_one is returning an error return value but this is not being assigned to err and the following check on err is currently always false because err was initialized to zero. Fix this by assigning err.

Addresses-Coverity: ("'Constant' variable guards dead code")

Fixes 22f67cdfae6a ("net: bridge: add helper to replay VLANs installed on port")
---
 net/bridge/br_vlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_vlan.c +0 -0
index ca8daccff217..7422691230b1 100644

net/bridge/br_vlan.c int br_vlan_replay(struct net_device *br_dev, struct net_device *dev, · line 1821

Quoted 8 lines
net/bridge/br_vlan.c +1 -1
@@ -1815,7 +1815,7 @@ int br_vlan_replay(struct net_device *br_dev, struct net_device *dev,
 		if (!br_vlan_should_use(v))
 			continue;
 
-		br_vlan_replay_one(nb, dev, &vlan, extack);
+		err = br_vlan_replay_one(nb, dev, &vlan, extack);
 		if (err)
 			return err;
 	}

Thanks,

#3 lore raw
In reply to Colin King
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 8 lines · On Wed, 24 Mar 2021 15:09:50 +0000 you wrote:

From: Colin Ian King <[email protected]>

The call to br_vlan_replay_one is returning an error return value but this is not being assigned to err and the following check on err is currently always false because err was initialized to zero. Fix this by assigning err.

[...]

Here is the summary with links:
- [next] net: bridge: Fix missing return assignment from br_vlan_replay_one call

    https://git.kernel.org/netdev/net-next/c/ad248f7761eb

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html