[PATCH] media: iris: Fix runtime PM imbalance in iris_enable_power_domains()

Wentao Liang posted 1 patch 1 week ago
drivers/media/platform/qcom/iris/iris_resources.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[PATCH] media: iris: Fix runtime PM imbalance in iris_enable_power_domains()
Posted by Wentao Liang 1 week ago
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")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/media/platform/qcom/iris/iris_resources.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/media/platform/qcom/iris/iris_resources.c
index 773f6548370a..d56bc8cc66ed 100644
--- a/drivers/media/platform/qcom/iris/iris_resources.c
+++ b/drivers/media/platform/qcom/iris/iris_resources.c
@@ -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;
 }
-- 
2.34.1
Re: [PATCH] media: iris: Fix runtime PM imbalance in iris_enable_power_domains()
Posted by Konrad Dybcio 3 days, 17 hours ago
On 9/17/26 11:57 AM, Wentao Liang wrote:
> 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")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---

Already fixed in:

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

Konrad