mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
media: sh_vou: fix pm_runtime_get_sync() usage count
[ Upstream commit6e8b1526db] The pm_runtime_get_sync() internally increments the dev->power.usage_count without decrementing it, even on errors. Replace it by the new pm_runtime_resume_and_get(), introduced by: commitdd8088d5a8("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") in order to properly decrement the usage counter, avoiding a potential PM usage counter leak. While here, check if the PM runtime error was caught at open time. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
64e291d697
commit
8318f7bc0e
|
|
@ -1133,7 +1133,11 @@ static int sh_vou_open(struct file *file)
|
||||||
if (v4l2_fh_is_singular_file(file) &&
|
if (v4l2_fh_is_singular_file(file) &&
|
||||||
vou_dev->status == SH_VOU_INITIALISING) {
|
vou_dev->status == SH_VOU_INITIALISING) {
|
||||||
/* First open */
|
/* First open */
|
||||||
pm_runtime_get_sync(vou_dev->v4l2_dev.dev);
|
err = pm_runtime_resume_and_get(vou_dev->v4l2_dev.dev);
|
||||||
|
if (err < 0) {
|
||||||
|
v4l2_fh_release(file);
|
||||||
|
goto done_open;
|
||||||
|
}
|
||||||
err = sh_vou_hw_init(vou_dev);
|
err = sh_vou_hw_init(vou_dev);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
pm_runtime_put(vou_dev->v4l2_dev.dev);
|
pm_runtime_put(vou_dev->v4l2_dev.dev);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user