Skip to contentSkip to conversation

media: iris: Fix runtime PM imbalance in iris_enable_power_domains()

PATCH In review Wentao Liang 2 participants 2 messages Sep 17 – Sep 21

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

PATCH 1/1 media: iris: Fix runtime PM imbalance in iris_enable_power_domains()

pm_runtime_get_sync() leaves the runtime PM usage count of pd_dev incremented even when resuming the device fails, and iris_enable_power_domains() returns immediately in that case, so the reference is never dropped.

Roll the usage count back with pm_runtime_put_noidle() on the error path.

Fixes bb8a95aa038e ("media: iris: implement power management")
---
 drivers/media/platform/qcom/iris/iris_resources.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/qcom/iris/iris_resources.c +3 -1
index 773f6548370a..d56bc8cc66ed 100644
@@ -79,8 +79,10 @@ int iris_enable_power_domains(struct iris_core *core, struct device *pd_dev)
 		return ret;
 
 	ret = pm_runtime_get_sync(pd_dev);
-	if (ret < 0)
+	if (ret < 0) {
+		pm_runtime_put_noidle(pd_dev);
 		return ret;
+	}
 
 	return ret;
 }
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Wentao Liang

pm_runtime_get_sync() leaves the runtime PM usage count of pd_dev incremented even when resuming the device fails, and iris_enable_power_domains() returns immediately in that case, so the reference is never dropped.

Quoted 7 lines

Roll the usage count back with pm_runtime_put_noidle() on the error path.

Fixes bb8a95aa038e ("media: iris: implement power management")

---

Already fixed in:

f87d7eda07fc ("media: qcom: iris: fix runtime PM reference leaks")

Konrad