This is a note to let you know that I've just added the patch titled net: dsa: microchip: Fix Wake-on-LAN check to not return an error to the 6.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-dsa-microchip-fix-wake-on-lan-check-to-not-retur.patch and it can be found in the queue-6.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 881f1d5fb207a51add1fd66cf2aabf4c58f6ae8f Author: Tristram Ha <tristram.ha@xxxxxxxxxxxxx> Date: Mon Aug 5 16:52:00 2024 -0700 net: dsa: microchip: Fix Wake-on-LAN check to not return an error [ Upstream commit c7a19018bd557c24072b59088ad2684fd83ea3f4 ] 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. Fixes: 3b454b6390c3 ("net: dsa: microchip: ksz9477: Add Wake on Magic Packet support") Signed-off-by: Tristram Ha <tristram.ha@xxxxxxxxxxxxx> Reviewed-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> Reviewed-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx> Link: https://patch.msgid.link/20240805235200.24982-1-Tristram.Ha@xxxxxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index baa1eeb9a1b04..077935cf5e381 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -3763,6 +3763,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,