Skip to contentSkip to conversation

net: marvell: prestera: fix uninitialized vid in prestera_port_vlans_add

PATCH Applied Vladimir Oltean 4 participants 4 messages Jan 14, 2021 – Jan 15, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: marvell: prestera: fix uninitialized vid in prestera_port_vlans_add

From: Vladimir Oltean <[email protected]>

prestera_bridge_port_vlan_add should have been called with vlan->vid, however this was masked by the presence of the local vid variable and I did not notice the build warning.

Fixes b7a9e0da2d1c ("net: switchdev: remove vid_begin -> vid_end range from VLAN objects")
---
 drivers/net/ethernet/marvell/prestera/prestera_switchdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/marvell/prestera/prestera_switchdev.c +1 -2
index beb6447fbe40..8c2b03151736 100644
@@ -1007,7 +1007,6 @@ static int prestera_port_vlans_add(struct prestera_port *port,
 	struct prestera_bridge_port *br_port;
 	struct prestera_switch *sw = port->sw;
 	struct prestera_bridge *bridge;
-	u16 vid;
 
 	if (netif_is_bridge_master(dev))
 		return 0;
@@ -1021,7 +1020,7 @@ static int prestera_port_vlans_add(struct prestera_port *port,
 		return 0;
 
 	return prestera_bridge_port_vlan_add(port, br_port,
-					     vid, flag_untagged,
+					     vlan->vid, flag_untagged,
 					     flag_pvid, extack);
 }
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Vladimir Oltean

From: Vladimir Oltean <[email protected]>

prestera_bridge_port_vlan_add should have been called with vlan->vid, however this was masked by the presence of the local vid variable and I did not notice the build warning.

Fixes b7a9e0da2d1c ("net: switchdev: remove vid_begin -> vid_end range from VLAN objects")
Signature · 1 line
Florian
Reviewed-by on v1 1/1
#2 lore raw
In reply to Vladimir Oltean

________________________________________
From: Vladimir Oltean <[email protected]>
Sent: Thursday, January 14, 2021 10:35 AM
To: David S. Miller; Jakub Kicinski; netdev(a)vger.kernel.org
Cc: Florian Fainelli; Kurt Kanzenbach; Vadym Kochan [C]; Taras Chornyi [C]; Ido Schimmel; clang-built-linux(a)googlegroups.com; linux-mm(a)kvack.org; kbuild-all(a)lists.01.org
Subject: [PATCH net-next] net: marvell: prestera: fix uninitialized vid in prestera_port_vlans_add
----------------------------------------------------------------------
From: Vladimir Oltean <[email protected]>

prestera_bridge_port_vlan_add should have been called with vlan->vid, however this was masked by the presence of the local vid variable and I did not notice the build warning.

Fixes b7a9e0da2d1c ("net: switchdev: remove vid_begin -> vid_end range from VLAN objects")
---
 drivers/net/ethernet/marvell/prestera/prestera_switchdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/marvell/prestera/prestera_switchdev.c +1 -2
index beb6447fbe40..8c2b03151736 100644
@@ -1007,7 +1007,6 @@ static int prestera_port_vlans_add(struct prestera_port *port,
        struct prestera_bridge_port *br_port;
        struct prestera_switch *sw = port->sw;
        struct prestera_bridge *bridge;
-       u16 vid;
 
        if (netif_is_bridge_master(dev))
                return 0;
@@ -1021,7 +1020,7 @@ static int prestera_port_vlans_add(struct prestera_port *port,
                return 0;
 
        return prestera_bridge_port_vlan_add(port, br_port,
-                                            vid, flag_untagged,
+                                            vlan->vid, flag_untagged,
                                             flag_pvid, extack);
 }
 

--
2.25.1

#3 lore raw
In reply to Vladimir Oltean
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 11 lines · On Thu, 14 Jan 2021 10:35:56 +0200 you wrote:

From: Vladimir Oltean <[email protected]>

prestera_bridge_port_vlan_add should have been called with vlan->vid, however this was masked by the presence of the local vid variable and I did not notice the build warning.

Fixes b7a9e0da2d1c ("net: switchdev: remove vid_begin -> vid_end range from VLAN objects")

[...]

Here is the summary with links:
- [net-next] net: marvell: prestera: fix uninitialized vid in prestera_port_vlans_add

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

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