Skip to contentSkip to conversation

wlcore: mesh: handle failure case of pm_runtime_get_sync

PATCH In review Navid Emamdoost 3 participants 3 messages Jun 5, 2020 – Jul 15, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wlcore: mesh: handle failure case of pm_runtime_get_sync

Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails.

---
 drivers/net/wireless/ti/wlcore/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ti/wlcore/main.c +3 -1
index f140f7d7f553..c7e4f5a80b9e 100644
@@ -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) {
Signature · 1 line
2.17.1
#1 lore raw
Quoted 3 lines · Navid Emamdoost

Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails.

Looks like we have a similar patch already in Linux next, care to check?

Regards,

Tony

#2 lore raw
In reply to Navid Emamdoost
Quoted 5 lines · Navid Emamdoost

Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails.

Already fixed by another patch.

Patch set to Rejected.

Signature · 3 lines
https://patchwork.kernel.org/patch/11588923/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches