summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/exynos4-is/fimc-capture.c
diff options
context:
space:
mode:
authorJonathan Bakker <xc-racer2@live.ca>2020-07-31 01:01:13 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-09-01 14:13:26 +0200
commite571f75b6b907dccc285c0e03f02fa261e79d981 (patch)
tree9e98b84a0c811a4133d45731b6ee814b95e2881e /drivers/media/platform/exynos4-is/fimc-capture.c
parent4e3991c1be32496fba045619cf7dd1b0fd2c9053 (diff)
downloadlinux-e571f75b6b907dccc285c0e03f02fa261e79d981.tar.bz2
media: exynos4-is: Handle duplicate calls to vidioc_streamoff
vidioc_streamoff can be called multiple times from userspace, but we should only call media_pipeline_stop when we're actually setup. This became more noticeable after commit 2a2599c66368 ("[media] media: entity: Catch unbalanced media_pipeline_stop calls") was merged as it added a WARN for unbalanced calls to media_pipeline_stop. Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/exynos4-is/fimc-capture.c')
-rw-r--r--drivers/media/platform/exynos4-is/fimc-capture.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
index 464a6174b77d..6000a4e789ad 100644
--- a/drivers/media/platform/exynos4-is/fimc-capture.c
+++ b/drivers/media/platform/exynos4-is/fimc-capture.c
@@ -1235,8 +1235,11 @@ static int fimc_cap_streamoff(struct file *file, void *priv,
if (ret < 0)
return ret;
- media_pipeline_stop(&vc->ve.vdev.entity);
- vc->streaming = false;
+ if (vc->streaming) {
+ media_pipeline_stop(&vc->ve.vdev.entity);
+ vc->streaming = false;
+ }
+
return 0;
}