]> git.baikalelectronics.ru Git - kernel.git/commit
media: sh_vou: fix pm_runtime_get_sync() usage count
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 23 Apr 2021 15:07:41 +0000 (17:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:53:09 +0000 (16:53 +0200)
commitad68818bc9bb05d1a6c5b19a529ea8e1e481771e
tree7b5f335780b3b93e5a7f585a25a513b808e1def0
parent70873912b7d0f22c088ac545446f052b0655a03c
media: sh_vou: fix pm_runtime_get_sync() usage count

[ Upstream commit 6e8b1526db164c9d4b9dacfb9bc48e365d7c4860 ]

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:
commit dd8088d5a896 ("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>
drivers/media/platform/sh_vou.c