From: Meng Li <Meng.Li@windriver.com>
To: stable@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
mcoquelin.stm32@gmail.com, linux@armlinux.org.uk, andrew@lunn.ch,
qiangqing.zhang@nxp.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
meng.li@windriver.com
Subject: [PATCH 3/6] net: stmmac: fix missing unlock on error in stmmac_suspend()
Date: Fri, 19 Nov 2021 10:53:56 +0800 [thread overview]
Message-ID: <20211119025359.30815-4-Meng.Li@windriver.com> (raw)
In-Reply-To: <20211119025359.30815-1-Meng.Li@windriver.com>
From: Yang Yingliang <yangyingliang@huawei.com>
commit 30f347ae7cc1178c431f968a89d4b4a375bc0d39 upstream
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>
Signed-off-by: Meng Li <Meng.Li@windriver.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 498962c4b59e..51626edc6a4c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5275,8 +5275,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);
--
2.17.1
next prev parent reply other threads:[~2021-11-19 2:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-19 2:53 [PATCH 0/6] backport patches to improve clocks management for stmmac driver Meng Li
2021-11-19 2:53 ` [PATCH 1/6] net: stmmac: add clocks management for gmac driver Meng Li
2021-11-19 2:53 ` [PATCH 2/6] net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP Meng Li
2021-11-19 2:53 ` Meng Li [this message]
2021-11-19 2:53 ` [PATCH 4/6] net: stmmac: fix system hang if change mac address after interface ifdown Meng Li
2021-11-19 2:53 ` [PATCH 5/6] net: stmmac: fix issue where clk is being unprepared twice Meng Li
2021-11-19 2:53 ` [PATCH 6/6] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings Meng Li
2021-11-19 13:29 ` [PATCH 0/6] backport patches to improve clocks management for stmmac driver Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211119025359.30815-4-Meng.Li@windriver.com \
--to=meng.li@windriver.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=qiangqing.zhang@nxp.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).