tg3: fix bug caused by uninitialized variable
Subsystems (3)
PATCH 1/1 tg3: fix bug caused by uninitialized variable
The reported bug is caused by using mii_eee_cap1_mod_linkmode_t() with an uninitialized bitmap. Fix this by zero-initializing the struct containing the bitmap.
--- drivers/net/ethernet/broadcom/tg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/tg3.c +1 -1
@@ -4616,7 +4616,7 @@ static int tg3_init_5401phy_dsp(struct tg3 *tp)static bool tg3_phy_eee_config_ok (struct tg3 *tp) { -struct ethtool_keee eee; +struct ethtool_keee eee = {};if (!(tp->phy_flags &TG3_PHYFLG_EEE_CAP ))return true;
Signature · 1 line
2.43.0
Quoted 27 lines · Heiner Kallweit
The reported bug is caused by using
mii_eee_cap1_mod_linkmode_t()with an uninitialized bitmap. Fix this by zero-initializing the struct containing the bitmap.Fixes 9bc791341bc9a5c22b ("tg3: convert EEE handling to use linkmode bitmaps")Reported-by Srikanth Aithal <[email protected]>Tested-by Srikanth Aithal <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>--- drivers/net/ethernet/broadcom/tg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/broadcom/tg3.c +1
-2@@ -4616,7 +4616,7 @@ static int tg3_init_5401phy_dsp(struct tg3 *tp)static bool tg3_phy_eee_config_ok (struct tg3 *tp) { -struct ethtool_keee eee; +struct ethtool_keee eee = {};if (!(tp->phy_flags &TG3_PHYFLG_EEE_CAP ))return true; --
Quoted 3 lines
2.43.0
Thanks.
Quoted 8 lines · Heiner Kallweit
The reported bug is caused by using
mii_eee_cap1_mod_linkmode_t()with an uninitialized bitmap. Fix this by zero-initializing the struct containing the bitmap.Fixes 9bc791341bc9a5c22b ("tg3: convert EEE handling to use linkmode bitmaps")Reported-by Srikanth Aithal <[email protected]>Tested-by Srikanth Aithal <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>
Andrew
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Quoted 10 lines · On Fri, 9 Feb 2024 07:47:39 +0100 you wrote:
The reported bug is caused by using
mii_eee_cap1_mod_linkmode_t()with an uninitialized bitmap. Fix this by zero-initializing the struct containing the bitmap.Fixes 9bc791341bc9a5c22b ("tg3: convert EEE handling to use linkmode bitmaps")Reported-by Srikanth Aithal <[email protected]>Tested-by Srikanth Aithal <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>[...]
Here is the summary with links:
- [net-next] tg3: fix bug caused by uninitialized variable
https://git.kernel.org/netdev/net-next/c/0972d1d979cc
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html