diff mbox series

wlcore: fix runtime pm imbalance in wlcore_regdomain_config

Message ID 20200520124649.10848-1-dinghao.liu@zju.edu.cn
State Awaiting Upstream
Delegated to: David Miller
Headers show
Series wlcore: fix runtime pm imbalance in wlcore_regdomain_config | expand

Commit Message

Dinghao Liu May 20, 2020, 12:46 p.m. UTC
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/net/wireless/ti/wlcore/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tony Lindgren May 20, 2020, 6:51 p.m. UTC | #1
* Dinghao Liu <dinghao.liu@zju.edu.cn> [200520 12:47]:
> pm_runtime_get_sync() increments the runtime PM usage counter even
> the call returns an error code. Thus a pairing decrement is needed
> on the error handling path to keep the counter balanced.

Acked-by: Tony Lindgren <tony@atomide.com>
Kalle Valo May 29, 2020, 5:34 p.m. UTC | #2
Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:

> pm_runtime_get_sync() increments the runtime PM usage counter even
> the call returns an error code. Thus a pairing decrement is needed
> on the error handling path to keep the counter balanced.
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> Acked-by: Tony Lindgren <tony@atomide.com>

Patch applied to wireless-drivers-next.git, thanks.

282a04bf1d80 wlcore: fix runtime pm imbalance in wlcore_regdomain_config
diff mbox series

Patch

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index f140f7d7f553..c7e4f5a80b9e 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -3662,8 +3662,10 @@  void wlcore_regdomain_config(struct wl1271 *wl)
 		goto out;
 
 	ret = pm_runtime_get_sync(wl->dev);
-	if (ret < 0)
+	if (ret < 0) {
+		pm_runtime_put_autosuspend(wl->dev);
 		goto out;
+	}
 
 	ret = wlcore_cmd_regdomain_config_locked(wl);
 	if (ret < 0) {