net: dsa: mv88e6xxx: Fix off by in one in mv88e6185_phylink_get_caps()
Subsystems (5)
PATCH 1/2 net: dsa: mv88e6xxx: Fix off by in one in mv88e6185_phylink_get_caps()
The <= ARRAY_SIZE() needs to be < ARRAY_SIZE() to prevent an out of bounds error.
Fixes d4ebf12bcec4 ("net: dsa: mv88e6xxx: populate supported_interfaces and mac_capabilities")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/mv88e6xxx/chip.c +1 -1
@@ -585,7 +585,7 @@ static void mv88e6185_phylink_get_caps(struct mv88e6xxx_chip *chip, int port, {u8 cmode = chip->ports[port].cmode; -if (cmode <=ARRAY_SIZE (mv88e6185_phy_interface_modes) && +if (cmode <ARRAY_SIZE (mv88e6185_phy_interface_modes) && mv88e6185_phy_interface_modes[cmode])__set_bit (mv88e6185_phy_interface_modes[cmode], config->supported_interfaces);
Signature · 1 line
2.20.1
PATCH 2/2 net: dsa: mv88e6xxx: Unlock on error in mv88e6xxx_port_bridge_join()
Call mv88e6xxx_reg_unlock(chip) before returning on this error path.
Fixes 7af4a361a62f ("net: dsa: mv88e6xxx: Improve isolation of standalone ports")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/mv88e6xxx/chip.c +1 -1
@@ -2602,7 +2602,7 @@ static int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, err =mv88e6xxx_port_set_map_da (chip, port, true);if (err) -return err; + goto unlock; err =mv88e6xxx_port_commit_pvid (chip, port);if (err)
Signature · 1 line
2.20.1
Quoted 5 lines · Dan Carpenter
The <=
ARRAY_SIZE()needs to be <ARRAY_SIZE()to prevent an out of bounds error.Fixes d4ebf12bcec4 ("net: dsa: mv88e6xxx: populate supported_interfaces and mac_capabilities")Signed-off-by Dan Carpenter <[email protected]>
Good catch, thanks.
Reviewed-by Russell King (Oracle) <[email protected]>
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 8 lines · On Mon, 7 Feb 2022 11:22:53 +0300 you wrote:
The <=
ARRAY_SIZE()needs to be <ARRAY_SIZE()to prevent an out of bounds error.Fixes d4ebf12bcec4 ("net: dsa: mv88e6xxx: populate supported_interfaces and mac_capabilities")Signed-off-by Dan Carpenter <[email protected]>--- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [1/2,net-next] net: dsa: mv88e6xxx: Fix off by in one in mv88e6185_phylink_get_caps()
https://git.kernel.org/netdev/net-next/c/dde41a697331 - [2/2,net-next] net: dsa: mv88e6xxx: Unlock on error in mv88e6xxx_port_bridge_join() https://git.kernel.org/netdev/net-next/c/ff62433883b3
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html