Skip to content

Commit 539d39a

Browse files
dinghaoliudavem330
authored andcommitted
net: smsc911x: Fix runtime PM imbalance on error
Remove runtime PM usage counter decrement when the increment function has not been called to keep the counter balanced. Signed-off-by: Dinghao Liu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e3181e9 commit 539d39a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/net/ethernet/smsc/smsc911x.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,20 +2493,20 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
24932493

24942494
retval = smsc911x_init(dev);
24952495
if (retval < 0)
2496-
goto out_disable_resources;
2496+
goto out_init_fail;
24972497

24982498
netif_carrier_off(dev);
24992499

25002500
retval = smsc911x_mii_init(pdev, dev);
25012501
if (retval) {
25022502
SMSC_WARN(pdata, probe, "Error %i initialising mii", retval);
2503-
goto out_disable_resources;
2503+
goto out_init_fail;
25042504
}
25052505

25062506
retval = register_netdev(dev);
25072507
if (retval) {
25082508
SMSC_WARN(pdata, probe, "Error %i registering device", retval);
2509-
goto out_disable_resources;
2509+
goto out_init_fail;
25102510
} else {
25112511
SMSC_TRACE(pdata, probe,
25122512
"Network interface: \"%s\"", dev->name);
@@ -2547,9 +2547,10 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
25472547

25482548
return 0;
25492549

2550-
out_disable_resources:
2550+
out_init_fail:
25512551
pm_runtime_put(&pdev->dev);
25522552
pm_runtime_disable(&pdev->dev);
2553+
out_disable_resources:
25532554
(void)smsc911x_disable_resources(pdev);
25542555
out_enable_resources_fail:
25552556
smsc911x_free_resources(pdev);

0 commit comments

Comments
 (0)