[PATCH] wifi: wlcore: release runtime PM ref on regdomain config failure

Runyu Xiao posted 1 patch 1 month, 1 week ago
drivers/net/wireless/ti/wlcore/main.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[PATCH] wifi: wlcore: release runtime PM ref on regdomain config failure
Posted by Runyu Xiao 1 month, 1 week ago
wlcore_regdomain_config() gets a runtime PM reference before sending
the regulatory-domain command. When
wlcore_cmd_regdomain_config_locked() fails, the function queues recovery
and returns without dropping that reference.

Release the reference after handling the command result so both success
and failure paths balance the preceding
pm_runtime_resume_and_get(). The recovery worker takes a separate
runtime PM reference and cannot release the reference held here.

Fixes: fa2648a34e73 ("wlcore: Add support for runtime PM")
Cc: stable@vger.kernel.org
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
---
 drivers/net/wireless/ti/wlcore/main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index be583ae331c0..ecf55e34caae 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -3726,10 +3726,8 @@ void wlcore_regdomain_config(struct wl1271 *wl)
 	ret = wlcore_cmd_regdomain_config_locked(wl);
-	if (ret < 0) {
-		wl12xx_queue_recovery_work(wl);
-		goto out;
-	}
+	if (ret < 0)
+		wl12xx_queue_recovery_work(wl);
 
 	pm_runtime_put_autosuspend(wl->dev);
 out:
 	mutex_unlock(&wl->mutex);
 }
-- 
2.34.1