diff options
author | 2022-12-26 16:13:27 +0900 | |
---|---|---|
committer | 2022-12-28 10:09:49 +0000 | |
commit | 8e6a8d7a3dd93e93645be061692cb4ee6702dff0 (patch) | |
tree | 52311bb7632e9d39660fd873602699b7970eccca /drivers/net/ethernet/renesas | |
parent | Merge branch 'netdev-doc-defaq' (diff) | |
download | linux-8e6a8d7a3dd93e93645be061692cb4ee6702dff0.tar.gz linux-8e6a8d7a3dd93e93645be061692cb4ee6702dff0.tar.bz2 linux-8e6a8d7a3dd93e93645be061692cb4ee6702dff0.zip |
net: ethernet: renesas: rswitch: Fix error path in renesas_eth_sw_probe()
If rswitch_init() returns non-zero and this driver is re-probed,
the following error happens:
renesas_eth_sw e6880000.ethernet: Unbalanced pm_runtime_enable!
So, fix error path in renesas_eth_sw_probe().
Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/renesas')
-rw-r--r-- | drivers/net/ethernet/renesas/rswitch.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c index e42ceaa0099f..473d86bdf97d 100644 --- a/drivers/net/ethernet/renesas/rswitch.c +++ b/drivers/net/ethernet/renesas/rswitch.c @@ -1786,6 +1786,11 @@ static int renesas_eth_sw_probe(struct platform_device *pdev) pm_runtime_get_sync(&pdev->dev); ret = rswitch_init(priv); + if (ret < 0) { + pm_runtime_put(&pdev->dev); + pm_runtime_disable(&pdev->dev); + return ret; + } device_set_wakeup_capable(&pdev->dev, 1); |