]> Git Repo - linux.git/commitdiff
broadcom: b44: Use b44_writephy() return value
authorArtem Chernyshev <[email protected]>
Mon, 14 Aug 2023 21:00:30 +0000 (00:00 +0300)
committerDavid S. Miller <[email protected]>
Wed, 16 Aug 2023 06:08:29 +0000 (07:08 +0100)
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 <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/broadcom/b44.c

index 392ec09a1d8a6f51a3af21a8cbccfc4419359568..3e4fb3c3e8342ad3dbf7aa32df03fc4ce57e3cad 100644 (file)
@@ -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;
This page took 0.063076 seconds and 4 git commands to generate.