]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
media: ti-vpe: Fix a missing check and reference count leak
authorQiushi Wu <wu000273@umn.edu>
Sun, 14 Jun 2020 02:56:05 +0000 (04:56 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:48:41 +0000 (14:48 +0100)
commit63c17624227911000b96c5b39703e4ce45f48894
tree7efc1e4fab27136efca4741c93973160e7b75664
parent3a643c8f1dd0ea20d2fc6c42b443337fe01815d4
media: ti-vpe: Fix a missing check and reference count leak

BugLink: https://bugs.launchpad.net/bugs/1902115
[ Upstream commit 7dae2aaaf432767ca7aa11fa84643a7c2600dbdd ]

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code, causing incorrect ref count if
pm_runtime_put_noidle() is not called in error handling paths.
And also, when the call of function vpe_runtime_get() failed,
we won't call vpe_runtime_put().
Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails
inside vpe_runtime_get().

Fixes: 4571912743ac ("[media] v4l: ti-vpe: Add VPE mem to mem driver")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
drivers/media/platform/ti-vpe/vpe.c