Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: sun8i-di: Fix runtime PM imbalance in deinterlace_start_streaming

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>

authored by

Dinghao Liu and committed by
Mauro Carvalho Chehab
f1995d5e 69306a94

+1 -1
+1 -1
drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
··· 589 589 int ret; 590 590 591 591 if (V4L2_TYPE_IS_OUTPUT(vq->type)) { 592 - ret = pm_runtime_get_sync(dev); 592 + ret = pm_runtime_resume_and_get(dev); 593 593 if (ret < 0) { 594 594 dev_err(dev, "Failed to enable module\n"); 595 595