Skip to content

Commit

Permalink
tg3: fix bug caused by uninitialized variable
Browse files Browse the repository at this point in the history
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: 9bc7913 ("tg3: convert EEE handling to use linkmode bitmaps")
Reported-by: Srikanth Aithal <sraithal@amd.com>
Tested-by: Srikanth Aithal <sraithal@amd.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Feb 12, 2024
1 parent 08f6271 commit 0972d1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0972d1d

Please sign in to comment.