diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-05-21 13:56:07 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-23 13:20:17 +0200 |
commit | 779096916daede26699e75e51b0c3a000410d8ad (patch) | |
tree | aefc1c3bf9a3e59b7b25286a466a472cb666fc83 | |
parent | 606578801afe6ec8bb03f5d494a4bae49a684ef3 (diff) |
media: camss: vfe: Fix runtime PM imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/media/platform/qcom/camss/camss-vfe.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c index a8c542fa647d..fc31c2c169cd 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -1265,12 +1265,12 @@ static int vfe_get(struct vfe_device *vfe) ret = vfe_set_clock_rates(vfe); if (ret < 0) - goto error_clocks; + goto error_pm_runtime_get; ret = camss_enable_clocks(vfe->nclocks, vfe->clock, vfe->camss->dev); if (ret < 0) - goto error_clocks; + goto error_pm_runtime_get; ret = vfe_reset(vfe); if (ret < 0) @@ -1282,7 +1282,7 @@ static int vfe_get(struct vfe_device *vfe) } else { ret = vfe_check_clock_rates(vfe); if (ret < 0) - goto error_clocks; + goto error_pm_runtime_get; } vfe->power_count++; @@ -1293,10 +1293,8 @@ static int vfe_get(struct vfe_device *vfe) error_reset: camss_disable_clocks(vfe->nclocks, vfe->clock); -error_clocks: - pm_runtime_put_sync(vfe->camss->dev); - error_pm_runtime_get: + pm_runtime_put_sync(vfe->camss->dev); camss_pm_domain_off(vfe->camss, vfe->id); error_pm_domain: |