Message ID | 3e4a74f6-3a3b-478d-b09a-6fb29b0f8252@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 0972d1d979ccfd2b71ef36a5a2b1ad092be21bb9 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] tg3: fix bug caused by uninitialized variable | expand |
On Fri, Feb 9, 2024 at 12:17 PM Heiner Kallweit <hkallweit1@gmail.com> 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 <sraithal@amd.com> > Tested-by: Srikanth Aithal <sraithal@amd.com> > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > --- > drivers/net/ethernet/broadcom/tg3.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c > index 50f674031..7d0a2f5f3 100644 > --- a/drivers/net/ethernet/broadcom/tg3.c > +++ b/drivers/net/ethernet/broadcom/tg3.c > @@ -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; > -- > 2.43.0 > > Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Thanks.
On Fri, Feb 09, 2024 at 07:47:39AM +0100, Heiner Kallweit 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 <sraithal@amd.com> > Tested-by: Srikanth Aithal <sraithal@amd.com> > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
Hello: This patch was applied to netdev/net-next.git (main) by David S. Miller <davem@davemloft.net>: 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 <sraithal@amd.com> > Tested-by: Srikanth Aithal <sraithal@amd.com> > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > > [...] 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!
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 50f674031..7d0a2f5f3 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -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;