mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/2] net: macb: call pm_runtime_put_sync on failure path
@ 2020-06-24 10:08 Claudiu Beznea
  2020-06-24 10:08 ` [PATCH v2 2/2] net: macb: free resources on failure path of at91ether_open() Claudiu Beznea
  2020-06-25 23:00 ` [PATCH v2 1/2] net: macb: call pm_runtime_put_sync on failure path David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Claudiu Beznea @ 2020-06-24 10:08 UTC (permalink / raw)
  To: nicolas.ferre, davem, kuba
  Cc: alexandre.belloni, antoine.tenart, netdev, linux-kernel, Claudiu Beznea

Call pm_runtime_put_sync() on failure path of at91ether_open.

Fixes: e6a41c23df0d ("net: macb: ensure interface is not suspended on at91rm9200")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---

Changes in v2:
- this patch is new in v2
- patch 2/2 in this series is based on this one

 drivers/net/ethernet/cadence/macb_main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 67933079aeea..96d62d73b933 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -3835,7 +3835,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)	|
@@ -3848,11 +3848,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 */
-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-25 23:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 10:08 [PATCH v2 1/2] net: macb: call pm_runtime_put_sync on failure path Claudiu Beznea
2020-06-24 10:08 ` [PATCH v2 2/2] net: macb: free resources on failure path of at91ether_open() Claudiu Beznea
2020-06-25 23:00   ` David Miller
2020-06-25 23:00 ` [PATCH v2 1/2] net: macb: call pm_runtime_put_sync on failure path David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®