Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

broadcom: b44: prevent uninitialized value usage

On execution path with raised B44_FLAG_EXTERNAL_PHY, b44_readphy()
leaves bmcr value uninitialized and it is used later in the code.

Add check of this flag at the beginning of the b44_nway_reset() and
exit early of the function with restarting autonegotiation if an
external PHY is used.

Fixes: 753f492093da ("[B44]: port to native ssb support")
Reviewed-by: Jonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Alexey Simakov <bigalex934@gmail.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20251205155815.4348-1-bigalex934@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Alexey Simakov and committed by
Jakub Kicinski
50b3db3e 6af2a01d

+3
+3
drivers/net/ethernet/broadcom/b44.c
··· 1790 1790 u32 bmcr; 1791 1791 int r; 1792 1792 1793 + if (bp->flags & B44_FLAG_EXTERNAL_PHY) 1794 + return phy_ethtool_nway_reset(dev); 1795 + 1793 1796 spin_lock_irq(&bp->lock); 1794 1797 b44_readphy(bp, MII_BMCR, &bmcr); 1795 1798 b44_readphy(bp, MII_BMCR, &bmcr);