]> git.itanic.dy.fi Git - linux-stable/commit
drm/tegra: sor: Do not leak runtime PM reference
authorPavel Machek (CIP) <pavel@denx.de>
Tue, 6 Apr 2021 11:54:14 +0000 (13:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jun 2021 07:58:58 +0000 (09:58 +0200)
commite4c3f7a6a3b241aab8aaebe50b7dbf11b5d8a5ee
tree42e4d03967f54dd8366256bb0686ce4900a42319
parent7f5a4b24cdbd7372770a02f23e347d7d9a9ac8f1
drm/tegra: sor: Do not leak runtime PM reference

[ Upstream commit 73a395c46704304b96bc5e2ee19be31124025c0c ]

It's theoretically possible for the runtime PM reference to leak if the
code fails anywhere between the pm_runtime_resume_and_get() and
pm_runtime_put() calls, so make sure to release the runtime PM reference
in that case.

Practically this will never happen because none of the functions will
fail on Tegra, but it's better for the code to be pedantic in case these
assumptions will ever become wrong.

Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
[treding@nvidia.com: add commit message]
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/tegra/sor.c