Skip to content

Commit 1d18e71

Browse files
jtstrsgregkh
authored andcommitted
broadcom: b44: prevent uninitialized value usage
[ Upstream commit 50b3db3 ] 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: 753f492 ("[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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 698f389 commit 1d18e71

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • drivers/net/ethernet/broadcom

drivers/net/ethernet/broadcom/b44.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,6 +1789,9 @@ static int b44_nway_reset(struct net_device *dev)
17891789
u32 bmcr;
17901790
int r;
17911791

1792+
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
1793+
return phy_ethtool_nway_reset(dev);
1794+
17921795
spin_lock_irq(&bp->lock);
17931796
b44_readphy(bp, MII_BMCR, &bmcr);
17941797
b44_readphy(bp, MII_BMCR, &bmcr);

0 commit comments

Comments
 (0)