summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2021-03-27 12:33:22 +0300
committerDavid S. Miller <davem@davemloft.net>2021-03-29 04:00:00 +0300
commit30f347ae7cc1178c431f968a89d4b4a375bc0d39 (patch)
tree9512f58635bc370b32b66e983ae70fc0f68dd4ca /drivers/net/ethernet
parent284fda1eff8a8b27d2cafd7dc8fb423d13720f21 (diff)
downloadlinux-30f347ae7cc1178c431f968a89d4b4a375bc0d39.tar.xz
net: stmmac: fix missing unlock on error in stmmac_suspend()
Add the missing unlock before return from stmmac_suspend() in the error handling case. Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 3a4f0c2d42a3..d34388b1ffcc 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5964,8 +5964,10 @@ int stmmac_suspend(struct device *dev)
/* Disable clock in case of PWM is off */
clk_disable_unprepare(priv->plat->clk_ptp_ref);
ret = pm_runtime_force_suspend(dev);
- if (ret)
+ if (ret) {
+ mutex_unlock(&priv->lock);
return ret;
+ }
}
mutex_unlock(&priv->lock);