]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: macb: call pm_runtime_put_sync on failure path
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Wed, 24 Jun 2020 10:08:17 +0000 (13:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Jun 2020 22:59:23 +0000 (15:59 -0700)
Call pm_runtime_put_sync() on failure path of at91ether_open.

Fixes: e042252bef86 ("net: macb: ensure interface is not suspended on at91rm9200")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c

index 257c4920cb886d7e87ea60f517d2ca72aedfe8d9..5705359a361244f1755a4214e861ba092e0afeb3 100644 (file)
@@ -3837,7 +3837,7 @@ static int at91ether_open(struct net_device *dev)
 
        ret = at91ether_start(dev);
        if (ret)
-               return ret;
+               goto pm_exit;
 
        /* Enable MAC interrupts */
        macb_writel(lp, IER, MACB_BIT(RCOMP)    |
@@ -3850,11 +3850,15 @@ static int at91ether_open(struct net_device *dev)
 
        ret = macb_phylink_connect(lp);
        if (ret)
-               return ret;
+               goto pm_exit;
 
        netif_start_queue(dev);
 
        return 0;
+
+pm_exit:
+       pm_runtime_put_sync(&lp->pdev->dev);
+       return ret;
 }
 
 /* Close the interface */