* [PATCH] net: smsc911x: Fix runtime PM imbalance on error
@ 2020-05-23 8:08 Dinghao Liu
2020-05-23 23:52 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2020-05-23 8:08 UTC (permalink / raw)
To: dinghao.liu, kjlu
Cc: Steve Glendinning, David S. Miller, Jakub Kicinski, netdev, linux-kernel
Remove runtime PM usage counter decrement when the
increment function has not been called to keep the
counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
drivers/net/ethernet/smsc/smsc911x.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 49a6a9167af4..fc168f85e7af 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -2493,20 +2493,20 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
retval = smsc911x_init(dev);
if (retval < 0)
- goto out_disable_resources;
+ goto out_init_fail;
netif_carrier_off(dev);
retval = smsc911x_mii_init(pdev, dev);
if (retval) {
SMSC_WARN(pdata, probe, "Error %i initialising mii", retval);
- goto out_disable_resources;
+ goto out_init_fail;
}
retval = register_netdev(dev);
if (retval) {
SMSC_WARN(pdata, probe, "Error %i registering device", retval);
- goto out_disable_resources;
+ goto out_init_fail;
} else {
SMSC_TRACE(pdata, probe,
"Network interface: \"%s\"", dev->name);
@@ -2547,9 +2547,10 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
return 0;
-out_disable_resources:
+out_init_fail:
pm_runtime_put(&pdev->dev);
pm_runtime_disable(&pdev->dev);
+out_disable_resources:
(void)smsc911x_disable_resources(pdev);
out_enable_resources_fail:
smsc911x_free_resources(pdev);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: smsc911x: Fix runtime PM imbalance on error
2020-05-23 8:08 [PATCH] net: smsc911x: Fix runtime PM imbalance on error Dinghao Liu
@ 2020-05-23 23:52 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-23 23:52 UTC (permalink / raw)
To: dinghao.liu; +Cc: kjlu, steve.glendinning, kuba, netdev, linux-kernel
From: Dinghao Liu <dinghao.liu@zju.edu.cn>
Date: Sat, 23 May 2020 16:08:20 +0800
> Remove runtime PM usage counter decrement when the
> increment function has not been called to keep the
> counter balanced.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-23 23:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-23 8:08 [PATCH] net: smsc911x: Fix runtime PM imbalance on error Dinghao Liu
2020-05-23 23:52 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).