]> git.baikalelectronics.ru Git - kernel.git/commitdiff
wlcore: fix runtime pm imbalance in wlcore_regdomain_config
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Wed, 20 May 2020 12:46:47 +0000 (20:46 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 29 May 2020 17:31:59 +0000 (20:31 +0300)
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200520124649.10848-1-dinghao.liu@zju.edu.cn
drivers/net/wireless/ti/wlcore/main.c

index 4421fc656b1c609c329b1429baee19b3b3512dd1..fa4ced9864c0e246a0e76a29aeeb2f9e16939412 100644 (file)
@@ -3665,8 +3665,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) {