mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
media: qcom: iris: fix runtime PM reference leaks
Use pm_runtime_resume_and_get() in iris_enable_power_domains()
to avoid leaking a runtime PM usage count on failure.
Also ensure pm_runtime_put_sync() is always called in
iris_disable_power_domains(), even when iris_opp_set_rate()
fails, so runtime PM references remain balanced.
Fixes: bb8a95aa03 ("media: iris: implement power management")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
This commit is contained in:
committed by
Bryan O'Donoghue
parent
460d3257a6
commit
f87d7eda07
@@ -78,20 +78,21 @@ int iris_enable_power_domains(struct iris_core *core, struct device *pd_dev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return pm_runtime_get_sync(pd_dev);
|
||||
return pm_runtime_resume_and_get(pd_dev);
|
||||
}
|
||||
|
||||
int iris_disable_power_domains(struct iris_core *core, struct device *pd_dev)
|
||||
{
|
||||
int ret;
|
||||
int pm_ret;
|
||||
|
||||
ret = iris_opp_set_rate(core->dev, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pm_runtime_put_sync(pd_dev);
|
||||
pm_ret = pm_runtime_put_sync(pd_dev);
|
||||
if (!ret)
|
||||
ret = pm_ret;
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct clk *iris_get_clk_by_type(struct iris_core *core, enum platform_clk_type clk_type)
|
||||
|
||||
Reference in New Issue
Block a user