net: dsa: microchip: Fix Wake-on-LAN check to not return an error
PATCH v2 1/1 net: dsa: microchip: Fix Wake-on-LAN check to not return an error
From: Tristram Ha <[email protected]>
The wol variable in ksz_port_set_mac_address() is declared with random data, but the code in ksz_get_wol call may not be executed so the WAKE_MAGIC check may be invalid resulting in an error message when setting a MAC address after starting the DSA driver.
---
v2
- Update with Oleksij's suggestion
drivers/net/dsa/microchip/ksz_common.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/dsa/microchip/ksz_common.c +5 -0
@@ -3764,6 +3764,11 @@ static int ksz_port_set_mac_address(struct dsa_switch *ds, int port,return -EBUSY ; } +/* Need to initialize variable as the code to fill in settings may +* not be executed. +*/ + wol.wolopts =0 ; +ksz_get_wol (ds, dp->index, &wol);if (wol.wolopts &WAKE_MAGIC ) { dev_err(ds->dev,
Signature · 1 line
2.34.1
Quoted 10 lines · On 8/5/24 16:52, [email protected] wrote:
From: Tristram Ha <[email protected]>
The wol variable in
ksz_port_set_mac_address()is declared with random data, but the code inksz_get_wolcall may not be executed so theWAKE_MAGICcheck may be invalid resulting in an error message when setting a MAC address after starting the DSA driver.Fixes 3b454b6390c3 ("net: dsa: microchip: ksz9477: Add Wake on Magic Packet support")Signed-off-by Tristram Ha <[email protected]>Reviewed-by Oleksij Rempel <[email protected]>
Signature · 1 line
Florian
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Mon, 5 Aug 2024 16:52:00 -0700 you wrote:
From: Tristram Ha <[email protected]>
The wol variable in
ksz_port_set_mac_address()is declared with random data, but the code inksz_get_wolcall may not be executed so theWAKE_MAGICcheck may be invalid resulting in an error message when setting a MAC address after starting the DSA driver.[...]
Here is the summary with links:
- [net,v2] net: dsa: microchip: Fix Wake-on-LAN check to not return an error
https://git.kernel.org/netdev/net/c/c7a19018bd55
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html