media: sun8i-di: Fix runtime PM imbalance in deinterlace_start_streaming
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Wed, 7 Apr 2021 05:46:06 +0000 (07:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:29 +0000 (14:47 +0200)
commit1b61ad26af553ccd8adfde76088366bbd927db61
treeea76fad99ab3e689104620df10bcc213e278d3d7
parent810cf54025b7c1562cb4dc1d7b93c5e4f9fc95f6
media: sun8i-di: Fix runtime PM imbalance in deinterlace_start_streaming

[ Upstream commit f1995d5e43cf897f63b4d7a7f84a252d891ae820 ]

pm_runtime_get_sync() will increase the runtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
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>
drivers/media/platform/sunxi/sun8i-di/sun8i-di.c