mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
media: platform: s3c-camif: Fix runtime PM imbalance on error
[ Upstream commit dafa3605fe
]
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.
Also, call pm_runtime_disable() when pm_runtime_get_sync() returns
an error code.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
37b6efc255
commit
a4ef57d1cb
1 changed files with 2 additions and 3 deletions
|
@ -475,7 +475,7 @@ static int s3c_camif_probe(struct platform_device *pdev)
|
|||
|
||||
ret = camif_media_dev_init(camif);
|
||||
if (ret < 0)
|
||||
goto err_alloc;
|
||||
goto err_pm;
|
||||
|
||||
ret = camif_register_sensor(camif);
|
||||
if (ret < 0)
|
||||
|
@ -509,10 +509,9 @@ static int s3c_camif_probe(struct platform_device *pdev)
|
|||
media_device_unregister(&camif->media_dev);
|
||||
media_device_cleanup(&camif->media_dev);
|
||||
camif_unregister_media_entities(camif);
|
||||
err_alloc:
|
||||
err_pm:
|
||||
pm_runtime_put(dev);
|
||||
pm_runtime_disable(dev);
|
||||
err_pm:
|
||||
camif_clk_put(camif);
|
||||
err_clk:
|
||||
s3c_camif_unregister_subdev(camif);
|
||||
|
|
Loading…
Reference in a new issue