tg3: fix bug caused by uninitialized variable
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 9 Feb 2024 06:47:39 +0000 (07:47 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Feb 2024 11:12:09 +0000 (11:12 +0000)
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 <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>
drivers/net/ethernet/broadcom/tg3.c

index 50f674031f72d01cc11810669d9da2375d9b7a74..7d0a2f5f32828b344842da6d92a95fa753251810 100644 (file)
@@ -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;