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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Alexey Simakov <[email protected]> Reviewed-by: Michael Chan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6af2a01 commit 50b3db3

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
@@ -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)