Skip to content

Commit

Permalink
broadcom: b44: Use b44_writephy() return value
Browse files Browse the repository at this point in the history
Return result of b44_writephy() instead of zero to
deal with possible error.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Artem Chernyshev authored and David S. Miller committed Aug 16, 2023
1 parent a552bfa commit 9944d20
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/net/ethernet/broadcom/b44.c
Original file line number Diff line number Diff line change
Expand Up @@ -1793,11 +1793,9 @@ static int b44_nway_reset(struct net_device *dev)
b44_readphy(bp, MII_BMCR, &bmcr);
b44_readphy(bp, MII_BMCR, &bmcr);
r = -EINVAL;
if (bmcr & BMCR_ANENABLE) {
b44_writephy(bp, MII_BMCR,
bmcr | BMCR_ANRESTART);
r = 0;
}
if (bmcr & BMCR_ANENABLE)
r = b44_writephy(bp, MII_BMCR,
bmcr | BMCR_ANRESTART);
spin_unlock_irq(&bp->lock);

return r;
Expand Down

0 comments on commit 9944d20

Please sign in to comment.