diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2022-12-26 10:13:27 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-12-28 13:09:49 +0300 |
commit | 8e6a8d7a3dd93e93645be061692cb4ee6702dff0 (patch) | |
tree | 52311bb7632e9d39660fd873602699b7970eccca /drivers/net/ethernet/renesas | |
parent | 81852018f240f9382f5fab3582de0a42cd059d08 (diff) | |
download | linux-8e6a8d7a3dd93e93645be061692cb4ee6702dff0.tar.xz |
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); |