Skip to content

Commit 50b3db3

Browse files
jtstrskuba-moo
authored andcommitted
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: 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>
1 parent 6af2a01 commit 50b3db3

File tree

1 file changed

+3
-0
lines changed
  • drivers/net/ethernet/broadcom

1 file changed

+3
-0
lines changed

drivers/net/ethernet/broadcom/b44.c

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

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

0 commit comments

Comments
 (0)